Skip to content

Commit

Permalink
Merge pull request #36 from dipu018/collections-error
Browse files Browse the repository at this point in the history
check for collections field in db.stats output
  • Loading branch information
dloucasfx committed Jul 21, 2022
2 parents f364a54 + 0f0f2ff commit 1f51592
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mongodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,9 @@ def do_server_status(self):
# stats counts
self.submit('gauge', 'objects',
db_stats['objects'], mongo_db)
self.submit('gauge', 'collections',
db_stats['collections'], mongo_db)
if 'collections' in db_stats:
self.submit('gauge', 'collections',
db_stats['collections'], mongo_db)
if 'numExtents' in db_stats:
self.submit('gauge', 'numExtents',
db_stats['numExtents'], mongo_db)
Expand Down

0 comments on commit 1f51592

Please sign in to comment.