MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / UniqueKey

Function UniqueKey

internal/metrics/stat.go:23–26  ·  view source on GitHub ↗
(serverId int64, keys []string, time string, version int32, itemId int64)

Source from the content-addressed store, hash-verified

21}
22
23func UniqueKey(serverId int64, keys []string, time string, version int32, itemId int64) string {
24 var keysData = strings.Join(keys, "$EDGE$")
25 return strconv.FormatUint(fnv.HashString(strconv.FormatInt(serverId, 10)+"@"+keysData+"@"+time+"@"+strconv.Itoa(int(version))+"@"+strconv.FormatInt(itemId, 10)), 10)
26}
27
28func (this *Stat) UniqueKey(version int32, itemId int64) string {
29 return UniqueKey(this.ServerId, this.Keys, this.Time, version, itemId)

Callers 3

BenchmarkSumStatFunction · 0.92
AddMethod · 0.85
UniqueKeyMethod · 0.85

Calls 1

HashStringFunction · 0.92

Tested by 1

BenchmarkSumStatFunction · 0.74