mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-02 22:27:19 +00:00
add metrics test
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package p2p
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/tendermint/tendermint/proto/tendermint/statesync"
|
||||
)
|
||||
|
||||
func TestValueToMetricsLabel(t *testing.T) {
|
||||
m := NopMetrics()
|
||||
r := &statesync.ParamsRequest{}
|
||||
str := m.ValueToMetricLabel(r)
|
||||
assert.Equal(t, "statesync_ParamsRequest", str)
|
||||
|
||||
// subsequent calls to the function should produce the same result
|
||||
str = m.ValueToMetricLabel(r)
|
||||
assert.Equal(t, "statesync_ParamsRequest", str)
|
||||
}
|
||||
Reference in New Issue
Block a user