(t *testing.T)
| 35 | } |
| 36 | |
| 37 | func TestStat_EncodeSumKey(t *testing.T) { |
| 38 | var a = assert.NewAssertion(t) |
| 39 | |
| 40 | var stat = &metrics.Stat{ |
| 41 | ServerId: 1, |
| 42 | Keys: []string{"${remoteAddr}"}, |
| 43 | Hash: "123456", |
| 44 | Value: 123, |
| 45 | Time: "20240101", |
| 46 | } |
| 47 | var sumKey = stat.EncodeSumKey(100) |
| 48 | t.Log(sumKey) |
| 49 | |
| 50 | serverId, timeString, version, err := metrics.DecodeSumKey(sumKey) |
| 51 | if err != nil { |
| 52 | t.Fatal(err) |
| 53 | } |
| 54 | t.Log(serverId, timeString, version) |
| 55 | a.IsTrue(serverId == 1) |
| 56 | a.IsTrue(timeString == "20240101") |
| 57 | a.IsTrue(version == 100) |
| 58 | } |
| 59 | |
| 60 | func TestStat_EncodeSumValue(t *testing.T) { |
| 61 | var a = assert.NewAssertion(t) |
nothing calls this directly
no test coverage detected