Skip to content

Commit

Permalink
Add support for MDT metrics
Browse files Browse the repository at this point in the history
Specifically, adding support for the num_exports metric for now.

Signed-Off-By: Joe Handzik <joseph.t.handzik@hpe.com>
  • Loading branch information
Joe Handzik committed Apr 26, 2017
1 parent 34dcbaa commit 9e291fe
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions sources/procfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,21 @@ func (s *lustreSource) generateOSTMetricTemplates() error {
return nil
}

func (s *lustreSource) generateMDTMetricTemplates() error {
metricMap := map[string]map[string]string{
"mdt/lustrefs-*": 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{
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9e291fe

Please sign in to comment.