diff options
author | Michael Elkins <melkins@tislabs.com> | 2011-11-11 01:24:42 +0000 |
---|---|---|
committer | Michael Elkins <melkins@tislabs.com> | 2011-11-11 01:24:42 +0000 |
commit | dc9809bdcea60e86bb831f72e4c7da0da17bcd2e (patch) | |
tree | 79728597e2316022d2afa69e950bd9bbd9df9f72 /scripts/analyze-rcynic-history.py | |
parent | 342e978ef4f65bb00b45aaf120a8b9fd1f1fbde3 (diff) | |
parent | acf83a1b20cc2802dad24aa2422c0bd54951c8e7 (diff) |
merge with ^/trunk
svn path=/branches/tk103/; revision=4084
Diffstat (limited to 'scripts/analyze-rcynic-history.py')
-rw-r--r-- | scripts/analyze-rcynic-history.py | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/scripts/analyze-rcynic-history.py b/scripts/analyze-rcynic-history.py index c3c8df2f..12c2d8ea 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): @@ -241,13 +243,9 @@ 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 title '""" + title + """' + #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): for plotline in plotlines: @@ -280,8 +278,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) |