mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-21 05:53:12 +00:00
27 lines
559 B
Python
27 lines
559 B
Python
#!/usr/bin/env python
|
|
|
|
|
|
import os, sys
|
|
import urllib
|
|
import json
|
|
|
|
configinfo = """\
|
|
graph_title Tahoe Helper Stats - Active Files
|
|
graph_vlabel bytes
|
|
graph_category tahoe
|
|
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"]
|
|
|
|
data = json.loads(urllib.urlopen(url).read())
|
|
print("fetched.value %d" % data["chk_upload_helper.active_uploads"])
|
|
|