From: Brian Warner Date: Wed, 16 Jul 2008 19:36:42 +0000 (-0700) Subject: munin/serverops: improve graph title X-Git-Url: https://git.rkrishnan.org/vdrive/%22file:/frontends/%22doc.html/(%5B%5E?a=commitdiff_plain;h=af0648c0f8177aab9ec67b4c6103fdddb7e03bab;p=tahoe-lafs%2Ftahoe-lafs.git munin/serverops: improve graph title --- diff --git a/misc/munin/tahoe_server_latency_ b/misc/munin/tahoe_server_latency_ index 2a6a1ca3..d30984ce 100644 --- a/misc/munin/tahoe_server_latency_ +++ b/misc/munin/tahoe_server_latency_ @@ -53,12 +53,23 @@ for k,v in os.environ.items(): node_urls.append( (nodename, v) ) node_urls.sort() +my_name = os.path.basename(sys.argv[0]) +PREFIX = "tahoe_server_latency_" +assert my_name.startswith(PREFIX) +my_name = my_name[len(PREFIX):] +(operation, percentile) = my_name.split("_", 1) +if percentile == "mean": + what = "mean" +else: + what = percentile.replace("_", ".") + "th percentile" + configinfo = \ -"""graph_title Tahoe Server Latency +"""graph_title Tahoe Server '%(operation)s' Latency graph_vlabel seconds graph_category tahoe -graph_info This graph shows server-side latency for storage operations -""" +graph_info This graph shows how long '%(operation)s' operations took on the storage server, the %(what)s delay between message receipt and response generation, calculated over the last thousand operations. +""" % {'operation': operation, + 'what': what} for nodename, url in node_urls: configinfo += "%s.label %s\n" % (nodename, nodename) @@ -72,14 +83,11 @@ if len(sys.argv) > 1: for nodename, url in node_urls: data = simplejson.loads(urllib.urlopen(url).read()) - my_name = os.path.basename(sys.argv[0]) - PREFIX = "tahoe_server_latency_" - assert my_name.startswith(PREFIX) - my_name = my_name[len(PREFIX):] - (operation, percentile) = my_name.split("_", 1) - if percentile != "mean": - percentile = percentile + "_percentile" - key = "storage_server.latencies.%s.%s" % (operation, percentile) + if percentile == "mean": + p_key = "mean" + else: + p_key = percentile + "_percentile" + key = "storage_server.latencies.%s.%s" % (operation, p_key) value = data["stats"][key] print "%s.value %s" % (nodename, value) diff --git a/misc/munin/tahoe_server_operations_ b/misc/munin/tahoe_server_operations_ index b8c2320d..c28490da 100644 --- a/misc/munin/tahoe_server_operations_ +++ b/misc/munin/tahoe_server_operations_ @@ -43,12 +43,17 @@ for k,v in os.environ.items(): node_urls.append( (nodename, v) ) node_urls.sort() +my_name = os.path.basename(sys.argv[0]) +PREFIX = "tahoe_server_operations_" +assert my_name.startswith(PREFIX) +operation = my_name[len(PREFIX):] + configinfo = \ -"""graph_title Tahoe Server Operations +"""graph_title Tahoe Server '%(operation)s' Operations graph_vlabel ops per second graph_category tahoe -graph_info This graph shows server-side storage operation rates -""" +graph_info This graph shows how many '%(operation)s' operations take place on the storage server +""" % {'operation': operation} for nodename, url in node_urls: configinfo += "%s.label %s\n" % (nodename, nodename) @@ -64,10 +69,6 @@ if len(sys.argv) > 1: for nodename, url in node_urls: data = simplejson.loads(urllib.urlopen(url).read()) - my_name = os.path.basename(sys.argv[0]) - PREFIX = "tahoe_server_operations_" - assert my_name.startswith(PREFIX) - operation = my_name[len(PREFIX):] key = "storage_server.%s" % operation value = data["counters"][key] print "%s.value %s" % (nodename, value)