mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-05 16:58:59 +00:00
33 lines
917 B
Python
Executable file
33 lines
917 B
Python
Executable file
#!/srv/newsblur/venv/newsblur/bin/python
|
|
|
|
import os
|
|
from vendor.munin.cassandra import MuninCassandraPlugin
|
|
|
|
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()
|