aboutsummaryrefslogtreecommitdiff
path: root/scripts/gc_summary.py
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2010-01-23 20:56:17 +0000
committerRob Austein <sra@hactrn.net>2010-01-23 20:56:17 +0000
commitbb175d89b79cffbb1306594db1dfff0af64cf682 (patch)
tree711153379555131e437bea5cbd5793b7b5546e9c /scripts/gc_summary.py
parentd45a725d6b80c7078a342737aa1cefda60869b83 (diff)
Fail gracefully when we have no data to plot
svn path=/scripts/gc_summary.py; revision=2963
Diffstat (limited to 'scripts/gc_summary.py')
-rw-r--r--scripts/gc_summary.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/gc_summary.py b/scripts/gc_summary.py
index 694f040f..7a5bd324 100644
--- a/scripts/gc_summary.py
+++ b/scripts/gc_summary.py
@@ -52,6 +52,10 @@ class datapoint(object):
changed[i.key].add(i.count)
changed = set(k for k, v in changed.iteritems() if len(v) > 10)
+ if not changed:
+ print "print 'No data yet, nothing to plot'"
+ return
+
print "set xdata time"
print "set timefmt '%Y-%m-%dT%H:%M:%S'"
print "set format x '%s'" % cls.timefmt
@@ -80,7 +84,6 @@ class datapoint(object):
if not cls.outname:
print "pause mouse any"
-
for filename in sys.argv[1:]:
for line in open(filename):
line = line.split()