Skip to content

Commit

Permalink
Append bcacheReadaheadMetrics when CacheReadaheads value exists
Browse files Browse the repository at this point in the history
Signed-off-by: Saleh Sal <[email protected]>
  • Loading branch information
0xack13 committed Mar 25, 2023
1 parent c8bc7a8 commit 5083bf8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions collector/bcache_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,19 @@ func bcachePeriodStatsToMetric(ps *bcache.PeriodStats, labelValue string) []bcac
extraLabelValue: labelValue,
},
}
if ps.CacheReadaheads != 0 {
bcacheReadaheadMetrics := []bcacheMetric{
{
name: "cache_readaheads_total",
desc: "Count of times readahead occurred.",
value: float64(ps.CacheReadaheads),
metricType: prometheus.CounterValue,
extraLabel: label,
extraLabelValue: labelValue,
},
}
metrics = append(metrics, bcacheReadaheadMetrics...)
}
return metrics
}

Expand Down

0 comments on commit 5083bf8

Please sign in to comment.