MCPcopy Create free account
hub / github.com/prometheus/procfs / MDStat

Method MDStat

mdstat.go:89–99  ·  view source on GitHub ↗

MDStat parses an mdstat-file (/proc/mdstat) and returns a slice of structs containing the relevant info. More information available here: https://raid.wiki.kernel.org/index.php/Mdstat

()

Source from the content-addressed store, hash-verified

87// structs containing the relevant info. More information available here:
88// https://raid.wiki.kernel.org/index.php/Mdstat
89func (fs FS) MDStat() ([]MDStat, error) {
90 data, err := os.ReadFile(fs.proc.Path("mdstat"))
91 if err != nil {
92 return nil, err
93 }
94 mdstat, err := parseMDStat(data)
95 if err != nil {
96 return nil, fmt.Errorf("%w: Cannot parse %v: %w", ErrFileParse, fs.proc.Path("mdstat"), err)
97 }
98 return mdstat, nil
99}
100
101// parseMDStat parses data from mdstat file (/proc/mdstat) and returns a slice of
102// structs containing the relevant info.

Callers 1

TestFS_MDStatFunction · 0.80

Calls 2

parseMDStatFunction · 0.85
PathMethod · 0.45

Tested by 1

TestFS_MDStatFunction · 0.64