Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MGS metrics #5

Merged
merged 1 commit into from
Mar 20, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions sources/procfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down