]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
helper: add another munin plugin
authorBrian Warner <warner@allmydata.com>
Thu, 27 Mar 2008 23:50:30 +0000 (16:50 -0700)
committerBrian Warner <warner@allmydata.com>
Thu, 27 Mar 2008 23:50:30 +0000 (16:50 -0700)
misc/munin/tahoe-helperstats-active.py [new file with mode: 0644]
misc/munin/tahoe-helperstats-fetched.py [new file with mode: 0644]
misc/munin/tahoe-helperstats.py [deleted file]

diff --git a/misc/munin/tahoe-helperstats-active.py b/misc/munin/tahoe-helperstats-active.py
new file mode 100644 (file)
index 0000000..b143d3d
--- /dev/null
@@ -0,0 +1,24 @@
+#! /usr/bin/python
+
+import os, sys
+import urllib
+import simplejson
+
+configinfo = """\
+graph_title Tahoe Helper Stats - Active Files
+graph_vlabel bytes
+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 = simplejson.loads(urllib.urlopen(url).read())
+print "fetched.value %d" % data["CHK_active_uploads"]
+
diff --git a/misc/munin/tahoe-helperstats-fetched.py b/misc/munin/tahoe-helperstats-fetched.py
new file mode 100644 (file)
index 0000000..d34aaab
--- /dev/null
@@ -0,0 +1,25 @@
+#! /usr/bin/python
+
+import os, sys
+import urllib
+import simplejson
+
+configinfo = """\
+graph_title Tahoe Helper Stats - Bytes Fetched
+graph_vlabel bytes
+graph_info This graph shows the amount of data being fetched by the helper
+fetched.label Bytes Fetched
+fetched.type GAUGE
+fetched.draw LINE1
+fetched.min 0
+"""
+
+if len(sys.argv) > 1:
+    if sys.argv[1] == "config":
+        print configinfo.rstrip()
+        sys.exit(0)
+
+url = os.environ["url"]
+
+data = simplejson.loads(urllib.urlopen(url).read())
+print "fetched.value %d" % data["CHK_fetched_bytes"]
diff --git a/misc/munin/tahoe-helperstats.py b/misc/munin/tahoe-helperstats.py
deleted file mode 100644 (file)
index d34aaab..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#! /usr/bin/python
-
-import os, sys
-import urllib
-import simplejson
-
-configinfo = """\
-graph_title Tahoe Helper Stats - Bytes Fetched
-graph_vlabel bytes
-graph_info This graph shows the amount of data being fetched by the helper
-fetched.label Bytes Fetched
-fetched.type GAUGE
-fetched.draw LINE1
-fetched.min 0
-"""
-
-if len(sys.argv) > 1:
-    if sys.argv[1] == "config":
-        print configinfo.rstrip()
-        sys.exit(0)
-
-url = os.environ["url"]
-
-data = simplejson.loads(urllib.urlopen(url).read())
-print "fetched.value %d" % data["CHK_fetched_bytes"]