Skip to content

Commit 005ee70

Browse files
authored
Merge pull request #7 from ejsuncy/patch-1
Correctly parse hour values
2 parents be26e07 + c0383b2 commit 005ee70

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

collectors/traffic_collector.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ func (c *TrafficCollector) Collect(ch chan<- prometheus.Metric) {
137137
times := strings.Split(val, ":")
138138
tmp, _ := strconv.ParseFloat(times[0], 64)
139139
metric = tmp * float64(3600)
140-
tmp, _ = strconv.ParseFloat(times[0], 64)
140+
tmp, _ = strconv.ParseFloat(times[1], 64)
141141
metric += tmp * float64(60)
142142
} else {
143143
metric, _ = strconv.ParseFloat(val, 64)

0 commit comments

Comments
 (0)