Add page_faults for mongodb wired tiger (#6732)

This commit is contained in:
Ross Lodge 2019-12-05 16:38:51 -08:00 committed by Daniel Nelson
parent 1f5be2bac7
commit e6c57e7df4
2 changed files with 4 additions and 0 deletions

View File

@ -248,6 +248,7 @@ func (d *MongodbData) AddDefaultStats() {
d.add(key, floatVal) d.add(key, floatVal)
} }
d.addStat(statLine, WiredTigerExtStats) d.addStat(statLine, WiredTigerExtStats)
d.add("page_faults", d.StatLine.FaultsCnt)
} }
} }

View File

@ -100,6 +100,7 @@ func TestAddWiredTigerStats(t *testing.T) {
PagesQueuedForEviction: 0, PagesQueuedForEviction: 0,
ServerEvictingPages: 0, ServerEvictingPages: 0,
WorkerThreadEvictingPages: 0, WorkerThreadEvictingPages: 0,
FaultsCnt: 204,
}, },
tags, tags,
) )
@ -116,6 +117,8 @@ func TestAddWiredTigerStats(t *testing.T) {
for key := range WiredTigerExtStats { for key := range WiredTigerExtStats {
assert.True(t, acc.HasFloatField("mongodb", key) || acc.HasInt64Field("mongodb", key), key) assert.True(t, acc.HasFloatField("mongodb", key) || acc.HasInt64Field("mongodb", key), key)
} }
assert.True(t, acc.HasInt64Field("mongodb", "page_faults"))
} }
func TestAddShardStats(t *testing.T) { func TestAddShardStats(t *testing.T) {