diff --git a/CHANGELOG.md b/CHANGELOG.md index b65a3008ff..2f85f51263 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,7 @@ * [BUGFIX] Strip path.rootfs from mountpoint labels #1421 * [BUGFIX] Fix empty string in path.rootfs #1464 * [BUGFIX] Fix typo in cpufreq metric names #1510 +* [BUGFIX] Fix network speed math #1580 ## 0.18.1 / 2019-06-04 diff --git a/collector/netclass_linux.go b/collector/netclass_linux.go index 8d8a984e11..cbfcb6286a 100644 --- a/collector/netclass_linux.go +++ b/collector/netclass_linux.go @@ -144,7 +144,7 @@ func (c *netClassCollector) Update(ch chan<- prometheus.Metric) error { } if ifaceInfo.Speed != nil { - speedBytes := int64(*ifaceInfo.Speed / 8 * 1000 * 1000) + speedBytes := int64(*ifaceInfo.Speed * 1000 * 1000 / 8) pushMetric(ch, c.subsystem, "speed_bytes", speedBytes, ifaceInfo.Name, prometheus.GaugeValue) }