source: trunk/misc/operations_helpers/munin/tahoe_helperstats_fetched

Last change on this file was b856238, checked in by Alexandre Detiste <alexandre.detiste@…>, at 2024-02-15T15:53:34Z

remove old Python2 future statements

  • Property mode set to 100644
File size: 580 bytes
Line 
1#!/usr/bin/env python
2
3
4import os, sys
5import urllib
6import json
7
8configinfo = """\
9graph_title Tahoe Helper Stats - Bytes Fetched
10graph_vlabel bytes
11graph_category tahoe
12graph_info This graph shows the amount of data being fetched by the helper
13fetched.label Bytes Fetched
14fetched.type GAUGE
15fetched.draw LINE1
16fetched.min 0
17"""
18
19if len(sys.argv) > 1:
20    if sys.argv[1] == "config":
21        print(configinfo.rstrip())
22        sys.exit(0)
23
24url = os.environ["url"]
25
26data = json.loads(urllib.urlopen(url).read())
27print("fetched.value %d" % data["chk_upload_helper.fetched_bytes"])
Note: See TracBrowser for help on using the repository browser.