mirror of
https://github.com/prometheus/node_exporter.git
synced 2024-12-28 23:19:46 -08:00
Update mdstat fixture based on linux source.
Update `Contains` matching for `resync=`
This commit is contained in:
parent
64b82596ef
commit
afac1f7433
|
@ -190,7 +190,9 @@ func parseMdstat(mdStatusFilePath string) ([]mdStatus, error) {
|
|||
|
||||
// If device is syncing at the moment, get the number of currently synced bytes,
|
||||
// otherwise that number equals the size of the device.
|
||||
if strings.Contains(lines[j], "recovery") || strings.Contains(lines[j], "resync") && !strings.Contains(lines[j], "resync=DELAYED") && !strings.Contains(lines[j], "resync=PENDING") {
|
||||
if strings.Contains(lines[j], "recovery") ||
|
||||
strings.Contains(lines[j], "resync") &&
|
||||
!strings.Contains(lines[j], "\tresync=") {
|
||||
syncedBlocks, err = evalBuildline(lines[j])
|
||||
if err != nil {
|
||||
return mdStates, fmt.Errorf("error parsing mdstat: %s", err)
|
||||
|
|
Loading…
Reference in a new issue