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

Method EncodeValueKey

internal/metrics/stat.go:36–42  ·  view source on GitHub ↗
(version int32)

Source from the content-addressed store, hash-verified

34}
35
36func (this *Stat) EncodeValueKey(version int32) string {
37 if this.Value < 0 {
38 this.Value = 0
39 }
40
41 return string(byteutils.Concat([]byte(this.Time), []byte{'_'}, int32ToBigEndian(version), int64ToBigEndian(this.ServerId), int64ToBigEndian(this.Value), []byte(this.Hash)))
42}
43
44func (this *Stat) EncodeSumKey(version int32) string {
45 return string(byteutils.Concat([]byte(this.Time), []byte{'_'}, int32ToBigEndian(version), int64ToBigEndian(this.ServerId)))

Callers 2

TestStat_EncodeValueKeyFunction · 0.80
InsertStatMethod · 0.80

Calls 2

int32ToBigEndianFunction · 0.85
int64ToBigEndianFunction · 0.85

Tested by 1

TestStat_EncodeValueKeyFunction · 0.64