prometheus / procfs

procfs provides functions to retrieve system, kernel and process metrics from the pseudo-filesystem proc.
Apache License 2.0
769 stars 317 forks source link

Missing value blocks_to_be_synced #636

Closed Finomosec closed 4 months ago

Finomosec commented 4 months ago

Hello,

here is my cat /proc/mdstat:

md0 : active raid5 sdf1[4] sde1[1] sdc1[2] sdb1[0]
      14650718208 blocks super 1.2 level 5, 512k chunk, algorithm 2 [4/3] [UUU_]
      [===================>.]  recovery = 99.9% (4882207424/4883572736) finish=7.8min speed=2908K/sec
      bitmap: 2/37 pages [8KB], 65536KB chunk

The total_blocks (14650718208) can differ from the block_to_be_synced [due to lack of a better name] (4883572736). But the output only gives the total_blocks.

https://github.com/prometheus/procfs/blob/5cca38bb07f4513b5b5d6a2e790a8486862b6c86/mdstat.go#L26

In this regex, the second \d contains the needed value.

Can you add it to the output?