From 4e444bb21ae6fa22b2d5d1bcafc90fba5a11c5f6 Mon Sep 17 00:00:00 2001 From: Robert Clark Date: Fri, 10 Mar 2017 12:02:18 -0600 Subject: [PATCH] Add MGS metrics Signed-Off-By: Robert Clark --- sources/procfs.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/sources/procfs.go b/sources/procfs.go index d7384d25..e6f8c636 100644 --- a/sources/procfs.go +++ b/sources/procfs.go @@ -65,11 +65,33 @@ func (s *lustreSource) generateOSSMetricTemplates() error { return nil } +func (s *lustreSource) generateMGSMetricTemplates() error { + metricMap := map[string]map[string]string{ + "mgs/MGS/osd/": map[string]string{ + "blocksize": "Filesystem block size in bytes", + "filesfree": "The number of inodes (objects) available", + "filestotal": "The maximum number of inodes (objects) the filesystem can hold", + "kbytesavail": "Number of kilobytes readily available in the pool", + "kbytesfree": "Number of kilobytes allocated to the pool", + "kbytestotal": "Capacity of the pool in kilobytes", + "quota_iused_estimate": "Returns '1' if a valid address is returned within the pool, referencing whether free space can be allocated", + }, + } + for path, _ := range metricMap { + for metric, helpText := range metricMap[path] { + newMetric := newLustreProcMetric(metric, "MGS", path, helpText) + s.lustreProcMetrics = append(s.lustreProcMetrics, newMetric) + } + } + return nil +} + func NewLustreSource() (LustreSource, error) { var l lustreSource l.basePath = "/proc/fs/lustre" //control which node metrics you pull via flags l.generateOSSMetricTemplates() + l.generateMGSMetricTemplates() return &l, nil }