Use int64 throughout the ZFS collector.
This avoids issues with integer overflows on 32-bit architectures. The Prometheus data format is float64, so regardless of the architecture we should handle large numbers. Fixes #629.
This commit is contained in:
parent
8661bbbb42
commit
e1f129c729
3 changed files with 24 additions and 24 deletions
|
|
@ -75,7 +75,7 @@ func (s zfsSysctl) metricName() string {
|
|||
return strings.Replace(parts[len(parts)-1], "-", "_", -1)
|
||||
}
|
||||
|
||||
func (c *zfsCollector) constSysctlMetric(subsystem string, sysctl zfsSysctl, value int) prometheus.Metric {
|
||||
func (c *zfsCollector) constSysctlMetric(subsystem string, sysctl zfsSysctl, value int64) prometheus.Metric {
|
||||
metricName := sysctl.metricName()
|
||||
|
||||
return prometheus.MustNewConstMetric(
|
||||
|
|
@ -90,7 +90,7 @@ func (c *zfsCollector) constSysctlMetric(subsystem string, sysctl zfsSysctl, val
|
|||
)
|
||||
}
|
||||
|
||||
func (c *zfsCollector) constPoolMetric(poolName string, sysctl zfsSysctl, value int) prometheus.Metric {
|
||||
func (c *zfsCollector) constPoolMetric(poolName string, sysctl zfsSysctl, value int64) prometheus.Metric {
|
||||
metricName := sysctl.metricName()
|
||||
|
||||
return prometheus.MustNewConstMetric(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue