MCPcopy Index your code
hub / github.com/GoEdgeLab/EdgeNode / initTestingTask

Function initTestingTask

internal/metrics/task_kv_test.go:310–330  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

308var testingTaskInitOnce = &sync.Once{}
309
310func initTestingTask() {
311 testingTask = metrics.NewKVTask(&serverconfigs.MetricItemConfig{
312 Id: 1,
313 IsOn: false,
314 Category: "tcp",
315 Period: 1,
316 PeriodUnit: serverconfigs.MetricItemPeriodUnitDay,
317 Keys: []string{"${remoteAddr}"},
318 Value: "${countRequest}",
319 })
320
321 err := testingTask.Init()
322 if err != nil {
323 log.Fatal(err)
324 }
325
326 err = testingTask.Start()
327 if err != nil {
328 log.Fatal(err)
329 }
330}
331
332func BenchmarkKVTask_Add(b *testing.B) {
333 runtime.GOMAXPROCS(1)

Callers 1

BenchmarkKVTask_AddFunction · 0.85

Calls 3

NewKVTaskFunction · 0.92
InitMethod · 0.65
StartMethod · 0.65

Tested by

no test coverage detected