Skip to content

Commit

Permalink
Merge pull request #268 from h3po/patch-1
Browse files Browse the repository at this point in the history
Ignore partitions on NVME devices by default
  • Loading branch information
beorn7 authored Jul 11, 2016
2 parents f660b32 + c3eba34 commit d48453a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion collector/diskstats_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const (
)

var (
ignoredDevices = flag.String("collector.diskstats.ignored-devices", "^(ram|loop|fd|(h|s|v|xv)d[a-z])\\d+$", "Regexp of devices to ignore for diskstats.")
ignoredDevices = flag.String("collector.diskstats.ignored-devices", "^(ram|loop|fd|(h|s|v|xv)d[a-z]|nvme\\d+n\\d+p)\\d+$", "Regexp of devices to ignore for diskstats.")
)

type diskstatsCollector struct {
Expand Down
13 changes: 13 additions & 0 deletions collector/fixtures/e2e-output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ node_disk_bytes_read{device="dm-5"} 4.3150848e+07
node_disk_bytes_read{device="mmcblk0"} 798720
node_disk_bytes_read{device="mmcblk0p1"} 81920
node_disk_bytes_read{device="mmcblk0p2"} 389120
node_disk_bytes_read{device="nvme0n1"} 2.377714176e+09
node_disk_bytes_read{device="sda"} 5.13713216512e+11
node_disk_bytes_read{device="sr0"} 0
node_disk_bytes_read{device="vda"} 1.6727491584e+10
Expand All @@ -205,6 +206,7 @@ node_disk_bytes_written{device="dm-5"} 5.89664256e+08
node_disk_bytes_written{device="mmcblk0"} 0
node_disk_bytes_written{device="mmcblk0p1"} 0
node_disk_bytes_written{device="mmcblk0p2"} 0
node_disk_bytes_written{device="nvme0n1"} 2.0199236096e+10
node_disk_bytes_written{device="sda"} 2.58916880384e+11
node_disk_bytes_written{device="sr0"} 0
node_disk_bytes_written{device="vda"} 1.0938236928e+11
Expand All @@ -219,6 +221,7 @@ node_disk_io_now{device="dm-5"} 0
node_disk_io_now{device="mmcblk0"} 0
node_disk_io_now{device="mmcblk0p1"} 0
node_disk_io_now{device="mmcblk0p2"} 0
node_disk_io_now{device="nvme0n1"} 0
node_disk_io_now{device="sda"} 0
node_disk_io_now{device="sr0"} 0
node_disk_io_now{device="vda"} 0
Expand All @@ -233,6 +236,7 @@ node_disk_io_time_ms{device="dm-5"} 58848
node_disk_io_time_ms{device="mmcblk0"} 136
node_disk_io_time_ms{device="mmcblk0p1"} 24
node_disk_io_time_ms{device="mmcblk0p2"} 68
node_disk_io_time_ms{device="nvme0n1"} 222766
node_disk_io_time_ms{device="sda"} 9.65388e+06
node_disk_io_time_ms{device="sr0"} 0
node_disk_io_time_ms{device="vda"} 4.1614592e+07
Expand All @@ -247,6 +251,7 @@ node_disk_io_time_weighted{device="dm-5"} 105632
node_disk_io_time_weighted{device="mmcblk0"} 156
node_disk_io_time_weighted{device="mmcblk0p1"} 24
node_disk_io_time_weighted{device="mmcblk0p2"} 68
node_disk_io_time_weighted{device="nvme0n1"} 1.032546e+06
node_disk_io_time_weighted{device="sda"} 8.2621804e+07
node_disk_io_time_weighted{device="sr0"} 0
node_disk_io_time_weighted{device="vda"} 2.077872228e+09
Expand All @@ -261,6 +266,7 @@ node_disk_read_time_ms{device="dm-5"} 924
node_disk_read_time_ms{device="mmcblk0"} 156
node_disk_read_time_ms{device="mmcblk0p1"} 24
node_disk_read_time_ms{device="mmcblk0p2"} 68
node_disk_read_time_ms{device="nvme0n1"} 21650
node_disk_read_time_ms{device="sda"} 1.8492372e+07
node_disk_read_time_ms{device="sr0"} 0
node_disk_read_time_ms{device="vda"} 8.655768e+06
Expand All @@ -275,6 +281,7 @@ node_disk_reads_completed{device="dm-5"} 3729
node_disk_reads_completed{device="mmcblk0"} 192
node_disk_reads_completed{device="mmcblk0p1"} 17
node_disk_reads_completed{device="mmcblk0p2"} 95
node_disk_reads_completed{device="nvme0n1"} 47114
node_disk_reads_completed{device="sda"} 2.5354637e+07
node_disk_reads_completed{device="sr0"} 0
node_disk_reads_completed{device="vda"} 1.775784e+06
Expand All @@ -289,6 +296,7 @@ node_disk_reads_merged{device="dm-5"} 0
node_disk_reads_merged{device="mmcblk0"} 3
node_disk_reads_merged{device="mmcblk0p1"} 3
node_disk_reads_merged{device="mmcblk0p2"} 0
node_disk_reads_merged{device="nvme0n1"} 4
node_disk_reads_merged{device="sda"} 3.4367663e+07
node_disk_reads_merged{device="sr0"} 0
node_disk_reads_merged{device="vda"} 15386
Expand All @@ -303,6 +311,7 @@ node_disk_sectors_read{device="dm-5"} 84279
node_disk_sectors_read{device="mmcblk0"} 1560
node_disk_sectors_read{device="mmcblk0p1"} 160
node_disk_sectors_read{device="mmcblk0p2"} 760
node_disk_sectors_read{device="nvme0n1"} 4.643973e+06
node_disk_sectors_read{device="sda"} 1.003346126e+09
node_disk_sectors_read{device="sr0"} 0
node_disk_sectors_read{device="vda"} 3.2670882e+07
Expand All @@ -317,6 +326,7 @@ node_disk_sectors_written{device="dm-5"} 1.151688e+06
node_disk_sectors_written{device="mmcblk0"} 0
node_disk_sectors_written{device="mmcblk0p1"} 0
node_disk_sectors_written{device="mmcblk0p2"} 0
node_disk_sectors_written{device="nvme0n1"} 3.9451633e+07
node_disk_sectors_written{device="sda"} 5.05697032e+08
node_disk_sectors_written{device="sr0"} 0
node_disk_sectors_written{device="vda"} 2.1363744e+08
Expand All @@ -331,6 +341,7 @@ node_disk_write_time_ms{device="dm-5"} 104684
node_disk_write_time_ms{device="mmcblk0"} 0
node_disk_write_time_ms{device="mmcblk0p1"} 0
node_disk_write_time_ms{device="mmcblk0p2"} 0
node_disk_write_time_ms{device="nvme0n1"} 1.011053e+06
node_disk_write_time_ms{device="sda"} 6.387796e+07
node_disk_write_time_ms{device="sr0"} 0
node_disk_write_time_ms{device="vda"} 2.069221364e+09
Expand All @@ -345,6 +356,7 @@ node_disk_writes_completed{device="dm-5"} 98918
node_disk_writes_completed{device="mmcblk0"} 0
node_disk_writes_completed{device="mmcblk0p1"} 0
node_disk_writes_completed{device="mmcblk0p2"} 0
node_disk_writes_completed{device="nvme0n1"} 1.07832e+06
node_disk_writes_completed{device="sda"} 2.8444756e+07
node_disk_writes_completed{device="sr0"} 0
node_disk_writes_completed{device="vda"} 6.038856e+06
Expand All @@ -359,6 +371,7 @@ node_disk_writes_merged{device="dm-5"} 0
node_disk_writes_merged{device="mmcblk0"} 0
node_disk_writes_merged{device="mmcblk0p1"} 0
node_disk_writes_merged{device="mmcblk0p2"} 0
node_disk_writes_merged{device="nvme0n1"} 43950
node_disk_writes_merged{device="sda"} 1.1134226e+07
node_disk_writes_merged{device="sr0"} 0
node_disk_writes_merged{device="vda"} 2.0711856e+07
Expand Down
3 changes: 3 additions & 0 deletions collector/fixtures/proc/diskstats
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@
254 1 vda1 668 85 5984 956 207 4266 35784 32772 0 8808 33720
254 2 vda2 1774936 15266 32663262 8654692 5991028 20707590 213601656 2069152216 0 41607628 2077801992
11 0 sr0 0 0 0 0 0 0 0 0 0 0 0
259 0 nvme0n1 47114 4 4643973 21650 1078320 43950 39451633 1011053 0 222766 1032546
259 1 nvme0n1p1 1140 0 9370 16 1 0 1 0 0 16 16
259 2 nvme0n1p2 45914 4 4631243 21626 1036885 43950 39451632 919480 0 131580 940970

0 comments on commit d48453a

Please sign in to comment.