tahoe-lafs/misc/operations_helpers/munin/tahoe_helperstats_active

27 lines
559 B
Plaintext
Raw Normal View History

#!/usr/bin/env python
import os, sys
import urllib
2017-01-19 22:39:53 +00:00
import json
configinfo = """\
2008-03-27 23:50:30 +00:00
graph_title Tahoe Helper Stats - Active Files
graph_vlabel bytes
graph_category tahoe
2008-03-27 23:50:30 +00:00
graph_info This graph shows the number of files being actively processed by the helper
fetched.label Active Files
fetched.draw LINE2
"""
if len(sys.argv) > 1:
if sys.argv[1] == "config":
print(configinfo.rstrip())
sys.exit(0)
url = os.environ["url"]
2017-01-19 22:39:53 +00:00
data = json.loads(urllib.urlopen(url).read())
print("fetched.value %d" % data["chk_upload_helper.active_uploads"])
2008-03-27 23:50:30 +00:00