Skip to content

Commit

Permalink
fixup! collector/diskstats: add block device rotational
Browse files Browse the repository at this point in the history
Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
  • Loading branch information
rexagod committed Sep 22, 2024
1 parent 50e3424 commit 8d1195c
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
17 changes: 17 additions & 0 deletions collector/fixtures/e2e-64k-page-output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,23 @@ node_disk_reads_merged_total{device="sdb"} 841
node_disk_reads_merged_total{device="sdc"} 141
node_disk_reads_merged_total{device="sr0"} 0
node_disk_reads_merged_total{device="vda"} 15386
# HELP node_disk_rotational Rotational indicates whether the device is a rotational disk (1) or not (0).
# TYPE node_disk_rotational gauge
node_disk_rotational{device="dm-0"} 0
node_disk_rotational{device="dm-1"} 0
node_disk_rotational{device="dm-2"} 0
node_disk_rotational{device="dm-3"} 0
node_disk_rotational{device="dm-4"} 0
node_disk_rotational{device="dm-5"} 0
node_disk_rotational{device="mmcblk0"} 0
node_disk_rotational{device="mmcblk0p1"} 0
node_disk_rotational{device="mmcblk0p2"} 0
node_disk_rotational{device="nvme0n1"} 0
node_disk_rotational{device="sda"} 1
node_disk_rotational{device="sdb"} 0
node_disk_rotational{device="sdc"} 0
node_disk_rotational{device="sr0"} 0
node_disk_rotational{device="vda"} 0
# HELP node_disk_write_time_seconds_total This is the total number of seconds spent by all writes.
# TYPE node_disk_write_time_seconds_total counter
node_disk_write_time_seconds_total{device="dm-0"} 1.1585578e+06
Expand Down
17 changes: 17 additions & 0 deletions collector/fixtures/e2e-output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,23 @@ node_disk_reads_merged_total{device="sdb"} 841
node_disk_reads_merged_total{device="sdc"} 141
node_disk_reads_merged_total{device="sr0"} 0
node_disk_reads_merged_total{device="vda"} 15386
# HELP node_disk_rotational Rotational indicates whether the device is a rotational disk (1) or not (0).
# TYPE node_disk_rotational gauge
node_disk_rotational{device="dm-0"} 0
node_disk_rotational{device="dm-1"} 0
node_disk_rotational{device="dm-2"} 0
node_disk_rotational{device="dm-3"} 0
node_disk_rotational{device="dm-4"} 0
node_disk_rotational{device="dm-5"} 0
node_disk_rotational{device="mmcblk0"} 0
node_disk_rotational{device="mmcblk0p1"} 0
node_disk_rotational{device="mmcblk0p2"} 0
node_disk_rotational{device="nvme0n1"} 0
node_disk_rotational{device="sda"} 1
node_disk_rotational{device="sdb"} 0
node_disk_rotational{device="sdc"} 0
node_disk_rotational{device="sr0"} 0
node_disk_rotational{device="vda"} 0
# HELP node_disk_write_time_seconds_total This is the total number of seconds spent by all writes.
# TYPE node_disk_write_time_seconds_total counter
node_disk_write_time_seconds_total{device="dm-0"} 1.1585578e+06
Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ require (
github.com/coreos/go-systemd/v22 v22.5.0
github.com/dennwc/btrfs v0.0.0-20240418142341-0167142bde7a
github.com/ema/qdisc v1.0.0
github.com/go-kit/log v0.2.1
github.com/godbus/dbus/v5 v5.1.0
github.com/hashicorp/go-envparse v0.1.0
github.com/hodgesds/perf-utils v0.7.0
Expand Down Expand Up @@ -37,6 +38,7 @@ require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/dennwc/ioctl v1.0.0 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/jpillora/backoff v1.0.0 // indirect
github.com/klauspost/compress v1.17.9 // indirect
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ github.com/dennwc/ioctl v1.0.0 h1:DsWAAjIxRqNcLn9x6mwfuf2pet3iB7aK90K4tF16rLg=
github.com/dennwc/ioctl v1.0.0/go.mod h1:ellh2YB5ldny99SBU/VX7Nq0xiZbHphf1DrtHxxjMk0=
github.com/ema/qdisc v1.0.0 h1:EHLG08FVRbWLg8uRICa3xzC9Zm0m7HyMHfXobWFnXYg=
github.com/ema/qdisc v1.0.0/go.mod h1:FhIc0fLYi7f+lK5maMsesDqwYojIOh3VfRs8EVd5YJQ=
github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU=
github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0=
github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA=
github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk=
github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
Expand Down

0 comments on commit 8d1195c

Please sign in to comment.