Skip to content

Commit

Permalink
check if key value is not none, as mapped is no longer the default
Browse files Browse the repository at this point in the history
Signed-off-by: Dani Louca <dlouca@splunk.com>
  • Loading branch information
dloucasfx committed Mar 31, 2020
1 parent 5ebd340 commit 92fd99c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mongodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ def do_server_status(self):
# memory
if 'mem' in server_status:
for t in ['resident', 'virtual', 'mapped']:
self.submit('gauge', 'mem.' + t, server_status['mem'][t])
mem_metric = server_status['mem'].get(t)
if mem_metric:
self.submit('gauge', 'mem.' + t, mem_metric)

# network
if 'network' in server_status:
Expand Down

0 comments on commit 92fd99c

Please sign in to comment.