]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/blob - misc/munin/tahoe-helperstats-active.py
helper stats: fix the /helper_status page, the recent conflict merging missed some...
[tahoe-lafs/tahoe-lafs.git] / misc / munin / tahoe-helperstats-active.py
1 #! /usr/bin/python
2
3 import os, sys
4 import urllib
5 import simplejson
6
7 configinfo = """\
8 graph_title Tahoe Helper Stats - Active Files
9 graph_vlabel bytes
10 graph_category tahoe
11 graph_info This graph shows the number of files being actively processed by the helper
12 fetched.label Active Files
13 fetched.draw LINE2
14 """
15
16 if len(sys.argv) > 1:
17     if sys.argv[1] == "config":
18         print configinfo.rstrip()
19         sys.exit(0)
20
21 url = os.environ["url"]
22
23 data = simplejson.loads(urllib.urlopen(url).read())
24 print "fetched.value %d" % data["chk_upload_helper.active_uploads"]
25