mirror of
https://github.com/viq/NewsBlur.git
synced 2025-08-05 16:49:45 +00:00
24 lines
626 B
Python
24 lines
626 B
Python
![]() |
import sys
|
||
|
|
||
|
class MuninGraph(object):
|
||
|
def __init__(self, graph_config, metrics):
|
||
|
self.graph_config = graph_config
|
||
|
self.metrics = metrics
|
||
|
|
||
|
def run(self):
|
||
|
cmd_name = None
|
||
|
if len(sys.argv) > 1:
|
||
|
cmd_name = sys.argv[1]
|
||
|
if cmd_name == 'config':
|
||
|
self.print_config()
|
||
|
else:
|
||
|
self.print_metrics()
|
||
|
|
||
|
def print_config(self):
|
||
|
for key,value in self.graph_config.items():
|
||
|
print '%s %s' % (key, value)
|
||
|
|
||
|
def print_metrics(self):
|
||
|
for key, value in self.metrics.items():
|
||
|
print '%s.value %s' % (key, value)
|