diff --git a/plugins/inputs/mongodb/mongodb_data.go b/plugins/inputs/mongodb/mongodb_data.go index 7659a1a35..6a2c0a86e 100644 --- a/plugins/inputs/mongodb/mongodb_data.go +++ b/plugins/inputs/mongodb/mongodb_data.go @@ -206,6 +206,7 @@ var WiredTigerExtStats = map[string]string{ "wtcache_pages_evicted_by_app_thread": "PagesEvictedByAppThread", "wtcache_pages_queued_for_eviction": "PagesQueuedForEviction", "wtcache_pages_read_into": "PagesReadIntoCache", + "wtcache_pages_written_from": "PagesWrittenFromCache", "wtcache_pages_requested_from": "PagesRequestedFromCache", "wtcache_server_evicting_pages": "ServerEvictingPages", "wtcache_worker_thread_evictingpages": "WorkerThreadEvictingPages", diff --git a/plugins/inputs/mongodb/mongodb_data_test.go b/plugins/inputs/mongodb/mongodb_data_test.go index 38e6cd6ad..4a1730211 100644 --- a/plugins/inputs/mongodb/mongodb_data_test.go +++ b/plugins/inputs/mongodb/mongodb_data_test.go @@ -106,6 +106,7 @@ func TestAddWiredTigerStats(t *testing.T) { BytesReadInto: 0, PagesEvictedByAppThread: 0, PagesQueuedForEviction: 0, + PagesWrittenFromCache: 1247, ServerEvictingPages: 0, WorkerThreadEvictingPages: 0, FaultsCnt: 204, diff --git a/plugins/inputs/mongodb/mongostat.go b/plugins/inputs/mongodb/mongostat.go index 70a0edf09..ee96d5f8b 100644 --- a/plugins/inputs/mongodb/mongostat.go +++ b/plugins/inputs/mongodb/mongostat.go @@ -203,6 +203,7 @@ type CacheStats struct { PagesEvictedByAppThread int64 `bson:"pages evicted by application threads"` PagesQueuedForEviction int64 `bson:"pages queued for eviction"` PagesReadIntoCache int64 `bson:"pages read into cache"` + PagesWrittenFromCache int64 `bson:"pages written from cache"` PagesRequestedFromCache int64 `bson:"pages requested from the cache"` ServerEvictingPages int64 `bson:"eviction server evicting pages"` WorkerThreadEvictingPages int64 `bson:"eviction worker thread evicting pages"` @@ -703,6 +704,7 @@ type StatLine struct { PagesEvictedByAppThread int64 PagesQueuedForEviction int64 PagesReadIntoCache int64 + PagesWrittenFromCache int64 PagesRequestedFromCache int64 ServerEvictingPages int64 WorkerThreadEvictingPages int64 @@ -1080,6 +1082,7 @@ func NewStatLine(oldMongo, newMongo MongoStatus, key string, all bool, sampleSec returnVal.PagesEvictedByAppThread = newStat.WiredTiger.Cache.PagesEvictedByAppThread returnVal.PagesQueuedForEviction = newStat.WiredTiger.Cache.PagesQueuedForEviction returnVal.PagesReadIntoCache = newStat.WiredTiger.Cache.PagesReadIntoCache + returnVal.PagesWrittenFromCache = newStat.WiredTiger.Cache.PagesWrittenFromCache returnVal.PagesRequestedFromCache = newStat.WiredTiger.Cache.PagesRequestedFromCache returnVal.ServerEvictingPages = newStat.WiredTiger.Cache.ServerEvictingPages returnVal.WorkerThreadEvictingPages = newStat.WiredTiger.Cache.WorkerThreadEvictingPages