Implement Lazy Loading of NameTable

Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
Jan-Otto Kröpke
2023-07-10 13:59:57 +02:00
committed by Jan-Otto Kröpke
parent 9b5bc37a42
commit 11218a95d0
3 changed files with 50 additions and 45 deletions

View File

@@ -12,10 +12,8 @@ import (
"github.com/go-kit/log/level"
)
var nametable = perflib.CounterNameTable
func MapCounterToIndex(name string) string {
return strconv.Itoa(int(nametable.LookupIndex(name)))
return strconv.Itoa(int(perflib.CounterNameTable.LookupIndex(name)))
}
func getPerflibSnapshot(objNames string) (map[string]*perflib.PerfObject, error) {