mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2024-12-26 15:29:04 +01:00
Add network device to metric names to NetstatCollector
This commit is contained in:
parent
0110547b68
commit
5659607993
@ -6,6 +6,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
"log"
|
"log"
|
||||||
|
"fmt"
|
||||||
)
|
)
|
||||||
|
|
||||||
const NETSTATFILE = `/proc/net/dev`
|
const NETSTATFILE = `/proc/net/dev`
|
||||||
@ -46,8 +47,7 @@ func (m *NetstatCollector) Read(interval time.Duration){
|
|||||||
for i, name := range matches {
|
for i, name := range matches {
|
||||||
v, err := strconv.ParseInt(f[i], 10, 0)
|
v, err := strconv.ParseInt(f[i], 10, 0)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
m.node[fmt.Sprintf("%s_%s", dev, name)] = float64(v) * 1.0e-3
|
||||||
m.node[name] = float64(v) * 1.0e-3
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user