Add latency stats to mongo input (#6733)
This commit is contained in:
committed by
Daniel Nelson
parent
695678c4a5
commit
6f9f0b7f01
@@ -142,6 +142,29 @@ func TestAddShardStats(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestAddLatencyStats(t *testing.T) {
|
||||
d := NewMongodbData(
|
||||
&StatLine{
|
||||
CommandOpsCnt: 73,
|
||||
CommandLatency: 364,
|
||||
ReadOpsCnt: 113,
|
||||
ReadLatency: 201,
|
||||
WriteOpsCnt: 7,
|
||||
WriteLatency: 55,
|
||||
},
|
||||
tags,
|
||||
)
|
||||
|
||||
var acc testutil.Accumulator
|
||||
|
||||
d.AddDefaultStats()
|
||||
d.flush(&acc)
|
||||
|
||||
for key := range DefaultLatencyStats {
|
||||
assert.True(t, acc.HasInt64Field("mongodb", key))
|
||||
}
|
||||
}
|
||||
|
||||
func TestAddShardHostStats(t *testing.T) {
|
||||
expectedHosts := []string{"hostA", "hostB"}
|
||||
hostStatLines := map[string]ShardHostStatLine{}
|
||||
|
||||
Reference in New Issue
Block a user