MCPcopy Create free account
hub / github.com/CovenantSQL/CovenantSQL / TestMetrics

Function TestMetrics

metric/covenantmetric_test.go:30–47  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

28)
29
30func TestMetrics(t *testing.T) {
31 flag.Parse()
32 log.SetLevel(log.DebugLevel)
33 reg := prometheus.NewRegistry()
34 reg.MustRegister(NewCovenantSQLCollector())
35 log.Debug("gauge Collector 'CovenantSQLCollector' registered.")
36
37 time.Sleep(1100 * time.Millisecond)
38 Convey("get metric", t, func() {
39 mfs, err := reg.Gather()
40 if err != nil {
41 t.Fatal(err)
42 }
43 for _, mf := range mfs {
44 log.Debugf("mfs: %s", mf.String())
45 }
46 })
47}

Callers

nothing calls this directly

Calls 6

SetLevelFunction · 0.92
DebugFunction · 0.92
DebugfFunction · 0.92
NewCovenantSQLCollectorFunction · 0.85
FatalMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected