Format with gofumpt

This commit is contained in:
Holger Obermaier
2026-02-16 14:16:03 +01:00
parent 9bb21b807a
commit 539581f952
28 changed files with 294 additions and 310 deletions

View File

@@ -123,28 +123,30 @@ mountLoop:
continue
}
tags := map[string]string{"type": "node", "device": linefields[0]}
total := (stat.Blocks * uint64(stat.Bsize)) / uint64(1000000000)
total := (stat.Blocks * uint64(stat.Bsize)) / uint64(1000_000_000)
if m.allowedMetrics["disk_total"] {
y, err := lp.NewMessage(
"disk_total",
tags,
m.meta,
map[string]any{
"value": total},
"value": total,
},
time.Now())
if err == nil {
y.AddMeta("unit", "GBytes")
output <- y
}
}
free := (stat.Bfree * uint64(stat.Bsize)) / uint64(1000000000)
free := (stat.Bfree * uint64(stat.Bsize)) / uint64(1000_000_000)
if m.allowedMetrics["disk_free"] {
y, err := lp.NewMessage(
"disk_free",
tags,
m.meta,
map[string]any{
"value": free},
"value": free,
},
time.Now())
if err == nil {
y.AddMeta("unit", "GBytes")
@@ -162,10 +164,12 @@ mountLoop:
y, err := lp.NewMessage(
"part_max_used",
map[string]string{
"type": "node"},
"type": "node",
},
m.meta,
map[string]any{
"value": int(part_max_used)},
"value": int(part_max_used),
},
time.Now())
if err == nil {
y.AddMeta("unit", "percent")