From c4347a4dc5ea8e87cf6230addcdff5a5b54ab82b Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Mon, 13 Aug 2018 19:22:30 +0200 Subject: fix parsing of chattymallocs output --- mysql.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mysql.py b/mysql.py index 3dd2680..95feb80 100644 --- a/mysql.py +++ b/mysql.py @@ -155,7 +155,12 @@ class Benchmark_MYSQL( Benchmark ): with open(log, "rb") as f: hist = {} for l in f.readlines(): - n = int(str(l).replace("chattymalloc: ", "")) + l = str(l, "utf-8").replace("chattymalloc: ", "") + try: + n = int(l) + except ValueError: + continue + if not n in hist: hist[n] = 0 hist[n] += 1 -- cgit v1.2.3