MCPcopy
hub / github.com/netdata/netdata / TestChart

Function TestChart

src/go/pkg/netdataapi/api_test.go:22–48  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

20}
21
22func TestChart(t *testing.T) {
23 w := &bytes.Buffer{}
24 api := New(w)
25
26 opts := ChartOpts{
27 TypeID: "system",
28 ID: "cpu",
29 Name: "cpu_system",
30 Title: "CPU Usage",
31 Units: "percentage",
32 Family: "cpu",
33 Context: "system.cpu",
34 ChartType: "line",
35 Priority: 1000,
36 UpdateEvery: 1,
37 Options: "",
38 Plugin: "system",
39 Module: "cpu",
40 }
41
42 api.CHART(opts)
43
44 expected := "CHART 'system.cpu' 'cpu_system' 'CPU Usage' 'percentage' 'cpu' 'system.cpu' " +
45 "'line' '1000' '1' '' 'system' 'cpu'\n"
46
47 require.Equal(t, expected, w.String())
48}
49
50func TestDimension(t *testing.T) {
51 w := &bytes.Buffer{}

Callers

nothing calls this directly

Calls 4

CHARTMethod · 0.80
EqualMethod · 0.80
NewFunction · 0.70
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…