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

Method getPriorityStats

bcache/get.go:315–344  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

313}
314
315func (p *parser) getPriorityStats() PriorityStats {
316 var res PriorityStats
317
318 if p.err != nil {
319 return res
320 }
321
322 path := path.Join(p.currentDir, "priority_stats")
323
324 file, err := os.Open(path)
325 if err != nil {
326 p.err = fmt.Errorf("failed to read: %s", path)
327 return res
328 }
329 defer file.Close()
330
331 scanner := bufio.NewScanner(file)
332 for scanner.Scan() {
333 err = parsePriorityStats(scanner.Text(), &res)
334 if err != nil {
335 p.err = fmt.Errorf("failed to parse path %q: %w", path, err)
336 return res
337 }
338 }
339 if err := scanner.Err(); err != nil {
340 p.err = fmt.Errorf("failed to parse path %q: %w", path, err)
341 return res
342 }
343 return res
344}
345
346func (p *parser) getWritebackRateDebug() WritebackRateDebugStats {
347 var res WritebackRateDebugStats

Callers 1

GetStatsFunction · 0.95

Calls 2

parsePriorityStatsFunction · 0.85
ErrMethod · 0.80

Tested by

no test coverage detected