2020-12-03 14:05:32 -05:00
|
|
|
#!/srv/newsblur/venv/newsblur3/bin/python
|
2011-12-02 16:22:38 -08:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
2016-11-11 11:06:33 -08:00
|
|
|
from vendor.munin.riak import MuninRiakPlugin
|
2011-12-02 16:22:38 -08:00
|
|
|
|
|
|
|
class RiakOpsPlugin(MuninRiakPlugin):
|
|
|
|
args = "-l 0 --base 1000"
|
|
|
|
vlabel = "ops/sec"
|
|
|
|
title = "Riak operations"
|
|
|
|
info = "Operations"
|
|
|
|
fields = (
|
|
|
|
('gets', dict(
|
|
|
|
label = "gets",
|
|
|
|
info = "gets",
|
|
|
|
type = "DERIVE",
|
|
|
|
min = "0",
|
|
|
|
)),
|
|
|
|
('puts', dict(
|
|
|
|
label = "puts",
|
|
|
|
info = "puts",
|
|
|
|
type = "DERIVE",
|
|
|
|
min = "0",
|
|
|
|
)),
|
|
|
|
)
|
|
|
|
|
|
|
|
def execute(self):
|
|
|
|
status = self.get_status()
|
|
|
|
return dict(
|
|
|
|
gets = status['node_gets_total'],
|
|
|
|
puts = status['node_puts_total'],
|
|
|
|
)
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
RiakOpsPlugin().run()
|