Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2022-01-14 16:52:34 +0300
committerBrecht Van Lommel <brecht@blender.org>2022-01-14 17:17:22 +0300
commit8ae6995e985b1a354e44c08cb023251d04a5113d (patch)
tree49905a28f2ba85c0337babf751c07c793da8ae82 /tests
parentc0d0e2788b062e6268a533de8cebc4af5625bc75 (diff)
Tests: show more precise numbers in benchmark charts
Diffstat (limited to 'tests')
-rw-r--r--tests/performance/api/graph.py11
-rw-r--r--tests/performance/api/graph.template.html1
2 files changed, 10 insertions, 2 deletions
diff --git a/tests/performance/api/graph.py b/tests/performance/api/graph.py
index f4d45fa858c..721b04d1f43 100644
--- a/tests/performance/api/graph.py
+++ b/tests/performance/api/graph.py
@@ -98,8 +98,15 @@ class TestGraph:
for entry in entries:
test_index = tests[entry.test]
revision_index = revisions[entry.revision]
- time = entry.output[output] if output in entry.output else -1.0
- rows[revision_index]['c'][test_index + 1] = {'f': None, 'v': time}
+ output_value = entry.output[output] if output in entry.output else -1.0
+
+ if output.find("memory") != -1:
+ formatted_value = '%.2f MB' % (output_value / (1024 * 1024))
+ else:
+ formatted_value = "%.4f" % output_value
+
+ cell = {'f': formatted_value, 'v': output_value}
+ rows[revision_index]['c'][test_index + 1] = cell
data = {'cols': cols, 'rows': rows}
return {'device': device_name, 'name': chart_name, 'data': data, 'chart_type': chart_type}
diff --git a/tests/performance/api/graph.template.html b/tests/performance/api/graph.template.html
index 147f1628c23..55610f76de7 100644
--- a/tests/performance/api/graph.template.html
+++ b/tests/performance/api/graph.template.html
@@ -28,6 +28,7 @@
ndt.addColumn('number', dt.getValue(x,0));
for(var y=1; y<dt.getNumberOfColumns(); y++) {
ndt.setValue(y-1, x+1, dt.getValue(x,y));
+ ndt.setFormattedValue(y-1, x+1, dt.getFormattedValue(x,y));
}
}
return ndt;