NewsBlur/config/munin/cassandra_pending

34 lines
917 B
Text
Raw Permalink Normal View History

2016-11-11 11:09:13 -08:00
#!/srv/newsblur/venv/newsblur/bin/python
2011-12-02 16:22:38 -08:00
import os
2016-11-11 11:06:33 -08:00
from vendor.munin.cassandra import MuninCassandraPlugin
2011-12-02 16:22:38 -08:00
class CassandraPendingPlugin(MuninCassandraPlugin):
title = "thread pool pending tasks"
args = "--base 1000 -l 0"
vlabel = "pending tasks"
scale = False
@property
def fields(self):
tpstats = self.tpstats()
fs = []
for name, stats in tpstats.items():
fs.append((name.lower().replace('-', '_'), dict(
label = name,
info = name,
type = "GAUGE",
min = "0",
)))
return fs
def execute(self):
tpstats = self.tpstats()
values = {}
for name, stats in tpstats.items():
values[name.lower().replace('-', '_')] = stats['pending']
return values
if __name__ == "__main__":
CassandraPendingPlugin().run()