Remove stddev and direction columns
This commit is contained in:
parent
0d48e0791b
commit
2bf939186d
10 changed files with 32 additions and 116 deletions
|
|
@ -6,14 +6,9 @@ import json
|
|||
import math
|
||||
import re
|
||||
import sqlite3
|
||||
import statistics
|
||||
import urllib.request
|
||||
|
||||
DIRECTION = {
|
||||
"LESS_IS_BETTER": -1,
|
||||
"NEUTRAL": 0,
|
||||
"MORE_IS_BETTER": 1,
|
||||
}
|
||||
|
||||
|
||||
def format_time(time):
|
||||
# If the fractional part of the second is not exactly 3 or 6 digits long,
|
||||
|
|
@ -31,15 +26,6 @@ def format_time(time):
|
|||
return time.isoformat()
|
||||
|
||||
|
||||
def stddev(values):
|
||||
if len(values) < 2:
|
||||
return None
|
||||
N = len(values)
|
||||
mean = sum(values) / N
|
||||
variance = sum(pow(value - mean, 2) for value in values) / (N - 1)
|
||||
return math.sqrt(variance)
|
||||
|
||||
|
||||
def get_run_data(con, run_id):
|
||||
(
|
||||
runner_name,
|
||||
|
|
@ -73,7 +59,6 @@ def get_run_data(con, run_id):
|
|||
benchmark,
|
||||
metric,
|
||||
unit,
|
||||
interpretation,
|
||||
error,
|
||||
) in con.execute(
|
||||
"""
|
||||
|
|
@ -82,7 +67,6 @@ def get_run_data(con, run_id):
|
|||
benchmark,
|
||||
metric,
|
||||
unit,
|
||||
interpretation,
|
||||
error
|
||||
FROM measurement
|
||||
WHERE run_id = ?
|
||||
|
|
@ -101,10 +85,8 @@ def get_run_data(con, run_id):
|
|||
values = [value for (value,) in values]
|
||||
|
||||
measurements[f"{metric}/{benchmark}"] = {
|
||||
"value": sum(values),
|
||||
"stddev": stddev(values),
|
||||
"value": statistics.mean(values),
|
||||
"unit": unit,
|
||||
"direction": DIRECTION.get(interpretation),
|
||||
}
|
||||
|
||||
if error_type:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue