MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / TestKVTask_Init

Function TestKVTask_Init

internal/metrics/task_kv_test.go:40–58  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

38}
39
40func TestKVTask_Init(t *testing.T) {
41 var task = metrics.NewKVTask(&serverconfigs.MetricItemConfig{
42 Id: 1,
43 IsOn: false,
44 Category: "",
45 Period: 0,
46 PeriodUnit: "",
47 Keys: nil,
48 Value: "",
49 })
50 err := task.Init()
51 if err != nil {
52 t.Fatal(err)
53 }
54 defer func() {
55 _ = task.Stop()
56 }()
57 t.Log("ok")
58}
59
60func TestKVTask_Add(t *testing.T) {
61 var task = metrics.NewKVTask(&serverconfigs.MetricItemConfig{

Callers

nothing calls this directly

Calls 4

NewKVTaskFunction · 0.92
LogMethod · 0.80
InitMethod · 0.65
StopMethod · 0.65

Tested by

no test coverage detected