summaryrefslogtreecommitdiffstats
path: root/storperf/db/graphite_db.py
diff options
context:
space:
mode:
Diffstat (limited to 'storperf/db/graphite_db.py')
-rw-r--r--storperf/db/graphite_db.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/storperf/db/graphite_db.py b/storperf/db/graphite_db.py
index 8fef071..c44d2aa 100644
--- a/storperf/db/graphite_db.py
+++ b/storperf/db/graphite_db.py
@@ -108,7 +108,10 @@ class GraphiteDB(object):
total += datapoint[0]
count += 1
- average = total / count
+ if count > 0:
+ average = total / count
+ else:
+ average = total
return average