mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-05 16:58:59 +00:00
30 lines
764 B
Text
30 lines
764 B
Text
![]() |
#!/usr/bin/env python
|
||
|
# -*- coding: utf-8 -*-
|
||
|
|
||
|
from vendor.munin.mongodb import MuninMongoDBPlugin
|
||
|
|
||
|
class MongoDBIndexMissesPlugin(MuninMongoDBPlugin):
|
||
|
args = "-l 0 --base 1000"
|
||
|
vlabel = "misses"
|
||
|
title = "MongoDB index misses"
|
||
|
info = "Number of index cache misses"
|
||
|
fields = (
|
||
|
('misses', dict(
|
||
|
label = "misses",
|
||
|
info = "Index cache misses",
|
||
|
type = "DERIVE",
|
||
|
min = "0",
|
||
|
)),
|
||
|
)
|
||
|
|
||
|
def execute(self):
|
||
|
status = self.connection.admin.command('serverStatus')
|
||
|
try:
|
||
|
value = status['indexCounters']['misses']
|
||
|
except KeyError:
|
||
|
value = "U"
|
||
|
return dict(misses=value)
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
MongoDBIndexMissesPlugin().run()
|