Skip to content

Commit

Permalink
[mongo] collect additional wiredtiger cache metrics (#18052)
Browse files Browse the repository at this point in the history
* collect additional wiredtiger cache metrics

* add changelog
  • Loading branch information
lu-zhengda authored Jul 16, 2024
1 parent 33d4a9f commit a469c25
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mongo/changelog.d/18052.added
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Collects 3 additional WiredTiger cache metrics from serverStatus
- wiredtiger.cache.bytes_read_into_cache
- wiredtiger.cache.bytes_written_from_cache
- wiredtiger.cache.pages_requested_from_cache
3 changes: 3 additions & 0 deletions mongo/datadog_checks/mongo/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@
"""
WIREDTIGER_METRICS = {
"wiredTiger.cache.bytes currently in the cache": (GAUGE, "wiredTiger.cache.bytes_currently_in_cache"),
"wiredTiger.cache.bytes read into cache": GAUGE,
"wiredTiger.cache.bytes written from cache": GAUGE,
"wiredTiger.cache.failed eviction of pages that exceeded the in-memory maximum": (
RATE,
"wiredTiger.cache.failed_eviction_of_pages_exceeding_the_in-memory_maximum",
Expand All @@ -270,6 +272,7 @@
"wiredTiger.cache.modified pages evicted": GAUGE,
"wiredTiger.cache.pages read into cache": GAUGE,
"wiredTiger.cache.pages written from cache": GAUGE,
"wiredTiger.cache.pages requested from the cache": (GAUGE, "wiredTiger.cache.pages_requested_from_cache"),
"wiredTiger.cache.pages currently held in the cache": (GAUGE, "wiredTiger.cache.pages_currently_held_in_cache"),
"wiredTiger.cache.pages evicted because they exceeded the in-memory maximum": (
RATE,
Expand Down
3 changes: 3 additions & 0 deletions mongo/metadata.csv
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,8 @@ mongodb.usage.writelock.count,gauge,,lock,,Number of write locks since server st
mongodb.usage.writelock.countps,gauge,,lock,second,Number of write locks per second,0,mongodb,,,
mongodb.usage.writelock.time,gauge,,microsecond,,Total time spent performing write locks in microseconds,-1,mongodb,,,
mongodb.wiredtiger.cache.bytes_currently_in_cache,gauge,,byte,,Size of the data currently in cache.,0,mongodb,bytes currently in the cache,,
mongodb.wiredtiger.cache.bytes_read_into_cache,gauge,,byte,,Number of bytes read into the cache.,-1,mongodb,bytes read into cache,,
mongodb.wiredtiger.cache.bytes_written_from_cache,gauge,,byte,,Number of bytes written from the cache.,-1,mongodb,bytes written from cache,,
mongodb.wiredtiger.cache.failed_eviction_of_pages_exceeding_the_in_memory_maximumps,gauge,,page,second,"Number of failed eviction of pages that exceeded the in-memory maximum, per second.",-1,mongodb,cache failed eviction of pages exceeding in-memory maximum ps,,
mongodb.wiredtiger.cache.in_memory_page_splits,gauge,,split,,In-memory page splits.,0,mongodb,cache in-memory page splits.,,
mongodb.wiredtiger.cache.maximum_bytes_configured,gauge,,byte,,Maximum cache size.,0,mongodb,cache maximum bytes configured,,
Expand All @@ -262,6 +264,7 @@ mongodb.wiredtiger.cache.pages_currently_held_in_cache,gauge,,page,,Number of pa
mongodb.wiredtiger.cache.pages_evicted_by_application_threadsps,gauge,,page,second,Number of page evicted by application threads per second.,-1,mongodb,pages evicted by application threads ps,,
mongodb.wiredtiger.cache.pages_evicted_exceeding_the_in_memory_maximumps,gauge,,page,second,"Number of pages evicted because they exceeded the cache in-memory maximum, per second.",-1,mongodb,pages evicted exceeding in-memory maximum ps,,
mongodb.wiredtiger.cache.pages_read_into_cache,gauge,,page,,Number of pages read into the cache.,-1,mongodb,pages read cache,,
mongodb.wiredtiger.cache.pages_requested_from_cache,gauge,,page,,Number of pages requested from the cache.,-1,mongodb,pages requested from cache,,
mongodb.wiredtiger.cache.pages_written_from_cache,gauge,,page,,Number of pages writtent from the cache,-1,mongodb,pages written cache,,
mongodb.wiredtiger.cache.tracked_dirty_bytes_in_cache,gauge,,byte,,Size of the dirty data in the cache.,0,mongodb,tracked dirty bytes in cache,,
mongodb.wiredtiger.cache.unmodified_pages_evicted,gauge,,page,,"Number of pages, that were not modified, evicted from the cache.",0,mongodb,cache unmodified pages evicted,,
Expand Down
1 change: 1 addition & 0 deletions mongo/tests/fixtures/serverStatus
Original file line number Diff line number Diff line change
Expand Up @@ -1068,6 +1068,7 @@
"pages currently held in the cache": 12,
"pages read into cache": 12,
"pages read into cache requiring lookaside entries": 12,
"pages requested from the cache": 12,
"pages written from cache": 12,
"page written requiring lookaside records": 12,
"pages written requiring in-memory restoration": 12
Expand Down
24 changes: 24 additions & 0 deletions mongo/tests/results/metrics-serverStatus.json
Original file line number Diff line number Diff line change
Expand Up @@ -1215,6 +1215,22 @@
"server:mongodb://testUser2:*****@localhost:27017/test"
]
},
{
"name": "mongodb.wiredtiger.cache.bytes_read_into_cache",
"type": 0,
"value": 12.0,
"tags": [
"server:mongodb://testUser2:*****@localhost:27017/test"
]
},
{
"name": "mongodb.wiredtiger.cache.bytes_written_from_cache",
"type": 0,
"value": 12.0,
"tags": [
"server:mongodb://testUser2:*****@localhost:27017/test"
]
},
{
"name": "mongodb.wiredtiger.cache.failed_eviction_of_pages_exceeding_the_in_memory_maximumps",
"type": 1,
Expand Down Expand Up @@ -1263,6 +1279,14 @@
"server:mongodb://testUser2:*****@localhost:27017/test"
]
},
{
"name": "mongodb.wiredtiger.cache.pages_requested_from_cache",
"type": 0,
"value": 12.0,
"tags": [
"server:mongodb://testUser2:*****@localhost:27017/test"
]
},
{
"name": "mongodb.wiredtiger.cache.pages_written_from_cache",
"type": 0,
Expand Down

0 comments on commit a469c25

Please sign in to comment.