aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Legoll <vincent.legoll@gmail.com>2020-03-20 22:44:50 +0100
committerJens Axboe <axboe@kernel.dk>2020-03-20 15:53:50 -0600
commit86c6ec280c38df9a68a2061eed2ec659e0a0f7c7 (patch)
treec6ee4b4bab421a7a909a4db10f6776a820bb4600
parentf4f8ef7cdea138cfaa2f3ca0ee31fa23d3bcf1cc (diff)
downloadblktrace-86c6ec280c38df9a68a2061eed2ec659e0a0f7c7.tar.gz
btt_plot.py: Use sum() instead of open-coding it to compute list average
Signed-off-by: Vincent Legoll <vincent.legoll@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rwxr-xr-xbtt/btt_plot.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/btt/btt_plot.py b/btt/btt_plot.py
index 76fcca8..9c6f207 100755
--- a/btt/btt_plot.py
+++ b/btt/btt_plot.py
@@ -125,10 +125,7 @@ def get_data(files):
def _avg(vals):
"""Computes average for array of values passed"""
- total = 0.0
- for val in vals:
- total += val
- return total / len(vals)
+ return sum(vals) / len(vals)
#------------------------------------------------------
if len(xs) < 1000: