| Line | |
|---|
| 1 | #!/usr/bin/env python |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | import os, sys |
|---|
| 5 | import urllib |
|---|
| 6 | import json |
|---|
| 7 | |
|---|
| 8 | configinfo = """\ |
|---|
| 9 | graph_title Tahoe Helper Stats - Active Files |
|---|
| 10 | graph_vlabel bytes |
|---|
| 11 | graph_category tahoe |
|---|
| 12 | graph_info This graph shows the number of files being actively processed by the helper |
|---|
| 13 | fetched.label Active Files |
|---|
| 14 | fetched.draw LINE2 |
|---|
| 15 | """ |
|---|
| 16 | |
|---|
| 17 | if len(sys.argv) > 1: |
|---|
| 18 | if sys.argv[1] == "config": |
|---|
| 19 | print(configinfo.rstrip()) |
|---|
| 20 | sys.exit(0) |
|---|
| 21 | |
|---|
| 22 | url = os.environ["url"] |
|---|
| 23 | |
|---|
| 24 | data = json.loads(urllib.urlopen(url).read()) |
|---|
| 25 | print("fetched.value %d" % data["chk_upload_helper.active_uploads"]) |
|---|
| 26 | |
|---|
Note: See
TracBrowser
for help on using the repository browser.