MCPcopy
hub / github.com/prometheus/node_exporter / TestFileFDStats

Function TestFileFDStats

collector/filefd_linux_test.go:20–33  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

18import "testing"
19
20func TestFileFDStats(t *testing.T) {
21 fileFDStats, err := parseFileFDStats("fixtures/proc/sys/fs/file-nr")
22 if err != nil {
23 t.Fatal(err)
24 }
25
26 if want, got := "1024", fileFDStats["allocated"]; want != got {
27 t.Errorf("want filefd allocated %q, got %q", want, got)
28 }
29
30 if want, got := "1631329", fileFDStats["maximum"]; want != got {
31 t.Errorf("want filefd maximum %q, got %q", want, got)
32 }
33}

Callers

nothing calls this directly

Calls 1

parseFileFDStatsFunction · 0.85

Tested by

no test coverage detected