Rework stats

This commit is contained in:
9seconds
2021-03-27 22:04:30 +03:00
parent 5eca6ecb05
commit bc2bd4510a
19 changed files with 273 additions and 232 deletions
+20
View File
@@ -0,0 +1,20 @@
package stats
import "sync"
var streamInfoPool = sync.Pool{
New: func() interface{} {
return &streamInfo{
tags: map[string]string{},
}
},
}
func acquireStreamInfo() *streamInfo {
return streamInfoPool.Get().(*streamInfo)
}
func releaseStreamInfo(info *streamInfo) {
info.Reset()
streamInfoPool.Put(info)
}