Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mongo] Add WiredTiger metrics
Browse files Browse the repository at this point in the history
[[email protected]] rebased on #1979 → `wiredtiger` option.
Ben McCann authored and yannmh committed Dec 21, 2015

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 09036fb commit fb918a5
Showing 3 changed files with 33 additions and 8 deletions.
35 changes: 29 additions & 6 deletions checks.d/mongo.py
Original file line number Diff line number Diff line change
@@ -235,13 +235,25 @@ class MongoDb(AgentCheck):
}

"""
Associates with the metric list to collect.
WiredTiger storage engine.
"""
AVAILABLE_METRICS = {
'durabilty': DURABILITY_METRICS,
'locks': LOCKS_METRICS,
'metrics.commands': COMMANDS_METRICS,
'tcmalloc': TCMALLOC_METRICS,
WIREDTIGER_METRICS = {

"wiredTiger.cache.bytes currently in the cache": GAUGE,
"wiredTiger.cache.failed eviction of pages that exceeded the in-memory maximum": GAUGE,
"wiredTiger.cache.in-memory page splits": GAUGE,
"wiredTiger.cache.maximum bytes configured": GAUGE,
"wiredTiger.cache.maximum page size at eviction": GAUGE,
"wiredTiger.cache.pages currently held in the cache": GAUGE,
"wiredTiger.cache.pages evicted because they exceeded the in-memory maximum": GAUGE,
"wiredTiger.cache.pages evicted by application threads": GAUGE,
"wiredTiger.concurrentTransactions.read.available": GAUGE,
"wiredTiger.concurrentTransactions.read.out": GAUGE,
"wiredTiger.concurrentTransactions.read.totalTickets": GAUGE,
"wiredTiger.concurrentTransactions.write.available": GAUGE,
"wiredTiger.concurrentTransactions.write.out": GAUGE,
"wiredTiger.concurrentTransactions.write.totalTickets": GAUGE,
}

"""
@@ -256,6 +268,17 @@ class MongoDb(AgentCheck):
'\.w\\b': ".intent_exclusive",
}

"""
Associates with the metric list to collect.
"""
AVAILABLE_METRICS = {
'durabilty': DURABILITY_METRICS,
'locks': LOCKS_METRICS,
'metrics.commands': COMMANDS_METRICS,
'tcmalloc': TCMALLOC_METRICS,
'wiredtiger': WIREDTIGER_METRICS,
}

def __init__(self, name, init_config, agentConfig, instances=None):
AgentCheck.__init__(self, name, init_config, agentConfig, instances)
self._last_state_by_server = {}
4 changes: 2 additions & 2 deletions checks/__init__.py
Original file line number Diff line number Diff line change
@@ -91,7 +91,7 @@ def normalize(self, metric, prefix=None):
"""Turn a metric into a well-formed metric name
prefix.b.c
"""
name = re.sub(r"[,\+\*\-/()\[\]{}]", "_", metric)
name = re.sub(r"[,\+\*\-/()\[\]{}\s]", "_", metric)
# Eliminate multiple _
name = re.sub(r"__+", "_", name)
# Don't start/end with _
@@ -832,7 +832,7 @@ def normalize(self, metric, prefix=None, fix_case=False):
if prefix is not None:
prefix = self.convert_to_underscore_separated(prefix)
else:
name = re.sub(r"[,\+\*\-/()\[\]{}]", "_", metric)
name = re.sub(r"[,\+\*\-/()\[\]{}\s]", "_", metric)
# Eliminate multiple _
name = re.sub(r"__+", "_", name)
# Don't start/end with _
2 changes: 2 additions & 0 deletions conf.d/mongo.yaml.example
Original file line number Diff line number Diff line change
@@ -28,8 +28,10 @@ instances:
# * `locks` - Locks
# * `metrics.commands` - Use of database commands
# * `tcmalloc` - TCMalloc memory allocator
# * `wiredtiger` - WiredTiger storage engine
# additional_metrics:
# - durability
# - locks
# - metrics.commands
# - tcmalloc
# - wiredtiger

0 comments on commit fb918a5

Please sign in to comment.