github.com/TeaOSLab/EdgeNode@v1.3.8/internal/metrics/sum_test.go (about)

     1  // Copyright 2023 GoEdge CDN goedge.cdn@gmail.com. All rights reserved. Official site: https://goedge.cn .
     2  
     3  package metrics_test
     4  
     5  import (
     6  	"github.com/TeaOSLab/EdgeNode/internal/metrics"
     7  	timeutil "github.com/iwind/TeaGo/utils/time"
     8  	"runtime"
     9  	"testing"
    10  )
    11  
    12  func BenchmarkSumStat(b *testing.B) {
    13  	runtime.GOMAXPROCS(2)
    14  
    15  	b.RunParallel(func(pb *testing.PB) {
    16  		for pb.Next() {
    17  			metrics.UniqueKey(1, []string{"1.2.3.4"}, timeutil.Format("Ymd"), 1, 1)
    18  		}
    19  	})
    20  }