Fix too fast benchmark results statistics

This commit is contained in:
shortcutme 2019-11-25 14:38:27 +01:00
parent 7b210429b5
commit 416e7d6fe0
No known key found for this signature in database
GPG Key ID: 5B63BAE6CB9613AE
1 changed files with 2 additions and 2 deletions

View File

@ -181,7 +181,7 @@ class ActionsPlugin:
yield self.formatResult(time_taken, time_standard)
yield "\n"
res[key] = "ok"
multiplers.append(time_standard / time_taken)
multiplers.append(time_standard / max(time_taken, 0.001))
except Exception as err:
res[key] = err
yield "Failed!\n! Error: %s\n\n" % Debug.formatException(err)
@ -193,7 +193,7 @@ class ActionsPlugin:
yield " - Total: %s tests\n" % len(res)
yield " - Success: %s tests\n" % len([res_key for res_key, res_val in res.items() if res_val == "ok"])
yield " - Failed: %s tests\n" % len([res_key for res_key, res_val in res.items() if res_val != "ok"])
if multiplers:
if any(multiplers):
multipler_avg = sum(multiplers) / len(multiplers)
multipler_title = self.getMultiplerTitle(multipler_avg)
yield " - Average speed factor: %.2fx (%s)" % (multipler_avg, multipler_title)