source: trunk/misc/operations_helpers/munin/tahoe_introstats

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: 858 bytes
Line 
1#!/usr/bin/env python
2
3
4import os, sys
5import urllib
6import json
7
8configinfo = """\
9graph_title Tahoe Introducer Stats
10graph_vlabel hosts
11graph_category tahoe
12graph_info This graph shows the number of hosts announcing and subscribing to various services
13storage_server.label Storage Servers
14storage_server.draw LINE1
15storage_hosts.label Distinct Storage Hosts
16storage_hosts.draw LINE1
17storage_client.label Clients
18storage_client.draw LINE2
19"""
20
21if len(sys.argv) > 1:
22    if sys.argv[1] == "config":
23        print(configinfo.rstrip())
24        sys.exit(0)
25
26url = os.environ["url"]
27
28data = json.loads(urllib.urlopen(url).read())
29print("storage_server.value %d" % data["announcement_summary"]["storage"])
30print("storage_hosts.value %d" % data["announcement_distinct_hosts"]["storage"])
31print("storage_client.value %d" % data["subscription_summary"]["storage"])
32
Note: See TracBrowser for help on using the repository browser.