From 44f6a95465dbf4ebd2c32af9050e08b8cf152463 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Thu, 10 Nov 2011 00:35:17 +0000 Subject: Minor changes I forgot to check in. svn path=/trunk/; revision=4076 --- scripts/analyze-rcynic-history.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'scripts/analyze-rcynic-history.py') diff --git a/scripts/analyze-rcynic-history.py b/scripts/analyze-rcynic-history.py index c3c8df2f..f4e9305d 100644 --- a/scripts/analyze-rcynic-history.py +++ b/scripts/analyze-rcynic-history.py @@ -116,7 +116,9 @@ class Host(object): @property def average_connection_time(self): - return float(sum(c.elapsed.total_seconds() for c in self.connections)) / float(self.connection_count) + return (float(sum(((c.elapsed.days * 24 * 3600 + c.elapsed.seconds) * 10**6 + c.elapsed.microseconds) + for c in self.connections)) / + float(self.connection_count * 10**6)) class Format(object): @@ -246,8 +248,10 @@ def plotter(f, hostnames, field, logscale = False): #set format x '%a%H' #set format x '%H:%M' #set format x '%a%H:%M' - set format x "%a\\n%H:%M" - set title '""" + title + """' + #set format x "%a\\n%H:%M" + #set format x "%m-%d\\n%H:%M" + set format x '%m/%d' + #set title '""" + title + """' plot""" + ",".join(" '-' using 1:2 with lines title '%s'" % h for h in hostnames) + "\n") for i in xrange(1, n): for plotline in plotlines: @@ -280,8 +284,7 @@ if show_plot: hostnames = sorted(summary.hostnames) else: hostnames = ("rpki.apnic.net", "rpki.ripe.net", "repository.lacnic.net", "rpki.afrinic.net", - "arin.rpki.net", "rgnet.rpki.net", - "rpki.surfnet.nl", "rpki.antd.nist.gov") + "arin.rpki.net", "rgnet.rpki.net", "rpki.antd.nist.gov") fields = [fmt.attr for fmt in Host.format if fmt.attr not in ("scaled_elapsed", "hostname")] if plot_to_one: plot_one(hostnames, fields) -- cgit v1.2.3 From 2640b5c464a73b11ad2f28b33d109278c26151b0 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Thu, 10 Nov 2011 00:51:17 +0000 Subject: Cleanup svn path=/trunk/; revision=4077 --- scripts/analyze-rcynic-history.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'scripts/analyze-rcynic-history.py') diff --git a/scripts/analyze-rcynic-history.py b/scripts/analyze-rcynic-history.py index f4e9305d..12c2d8ea 100644 --- a/scripts/analyze-rcynic-history.py +++ b/scripts/analyze-rcynic-history.py @@ -243,14 +243,8 @@ def plotter(f, hostnames, field, logscale = False): f.write(""" set xdata time set timefmt '%Y-%m-%dT%H:%M:%SZ' - #set format x '%H:%M:%S' - #set format x '%m-%d' - #set format x '%a%H' - #set format x '%H:%M' - #set format x '%a%H:%M' - #set format x "%a\\n%H:%M" - #set format x "%m-%d\\n%H:%M" - set format x '%m/%d' + #set format x '%m/%d' + set format x '%b%d' #set title '""" + title + """' plot""" + ",".join(" '-' using 1:2 with lines title '%s'" % h for h in hostnames) + "\n") for i in xrange(1, n): -- cgit v1.2.3