From 89c44dbe7c1bebf86746f40d335bb51fa5f38fbb Mon Sep 17 00:00:00 2001 From: Joe Handzik Date: Tue, 11 Apr 2017 14:57:51 -0500 Subject: [PATCH] Add support for MDT metrics Specifically, adding support for the num_exports metric for now. Signed-Off-By: Joe Handzik --- sources/procfs.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/sources/procfs.go b/sources/procfs.go index f301ba58..79873c9d 100644 --- a/sources/procfs.go +++ b/sources/procfs.go @@ -114,6 +114,21 @@ func (s *lustreSource) generateOSTMetricTemplates() error { return nil } +func (s *lustreSource) generateMDTMetricTemplates() error { + metricMap := map[string]map[string]string{ + "mdt/*": map[string]string{ + "num_exports": "Total number of times the pool has been exported", + }, + } + for path, _ := range metricMap { + for metric, helpText := range metricMap[path] { + newMetric := newLustreProcMetric(metric, "MDT", path, helpText) + s.lustreProcMetrics = append(s.lustreProcMetrics, newMetric) + } + } + return nil +} + func (s *lustreSource) generateMGSMetricTemplates() error { metricMap := map[string]map[string]string{ "mgs/MGS/osd/": map[string]string{ @@ -161,6 +176,7 @@ func NewLustreSource() (LustreSource, error) { l.basePath = "/proc/fs/lustre" //control which node metrics you pull via flags l.generateOSTMetricTemplates() + l.generateMDTMetricTemplates() l.generateMGSMetricTemplates() l.generateMDSMetricTemplates() return &l, nil