feat: Add cumulative disk read/write totals to Disk I/O sheet (#2179)

This commit is contained in:
Sven van Ginkel
2026-08-30 21:44:18 +02:00
committed by GitHub
parent 8675199e20
commit b38fb7dafa
7 changed files with 116 additions and 3 deletions

View File

@@ -35,6 +35,20 @@ func TestStatsBatteryTransport(t *testing.T) {
assert.Equal(t, stats.Batteries, decoded.Batteries)
}
func TestStatsDiskIOTotalAndFansTransport(t *testing.T) {
stats := Stats{
DiskIOTotal: [2]uint64{437348527104, 331522465792},
Fans: map[string]uint16{"cpu": 1200},
}
cborData, err := cbor.Marshal(stats)
require.NoError(t, err)
var decoded Stats
require.NoError(t, cbor.Unmarshal(cborData, &decoded))
assert.Equal(t, stats.DiskIOTotal, decoded.DiskIOTotal)
assert.Equal(t, stats.Fans, decoded.Fans)
}
func TestStatsBatteryNumericArrayUnmarshal(t *testing.T) {
var stats Stats
require.NoError(t, json.Unmarshal([]byte(`{"bat":[50,4]}`), &stats))