mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-12-15 23:26:36 +08:00
增加对任务的执行时间追踪工具
This commit is contained in:
@@ -517,3 +517,16 @@ func BenchmarkFileStorage_Read(b *testing.B) {
|
||||
_ = reader.Close()
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkFileStorage_KeyPath(b *testing.B) {
|
||||
runtime.GOMAXPROCS(1)
|
||||
|
||||
var storage = &FileStorage{
|
||||
cacheConfig: &serverconfigs.HTTPFileCacheStorage{},
|
||||
policy: &serverconfigs.HTTPCachePolicy{Id: 1},
|
||||
}
|
||||
|
||||
for i := 0; i < b.N; i++ {
|
||||
_, _ = storage.keyPath(strconv.Itoa(i))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user