From 03ad327ca2a00e9bfc8d2478da94483639ae4e7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 16 Aug 2018 14:43:29 +0200 Subject: [PATCH] Include Benchmark Client version information in the result JSON MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This part of the JSON schema isn't required yet. When missing, the version is assumed to be -∞ --- benchmark/space/__init__.py | 13 ++++++++++++- benchmark/submission/client.py | 7 ++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/benchmark/space/__init__.py b/benchmark/space/__init__.py index dda183a..d8e5a4a 100644 --- a/benchmark/space/__init__.py +++ b/benchmark/space/__init__.py @@ -223,6 +223,16 @@ def modify_device_info(device_info): return device_info +def benchmark_client_info() -> dict: + """Metadata about the Benchmark Client itself.""" + + from ..version import version + + return { + 'client_version': version, + } + + def benchmark_thread(ctx): with G.progress_lock: G.progress_status = "Collecting system information." @@ -252,7 +262,8 @@ def benchmark_thread(ctx): "blender_version": system_info.getBlenderVersion(ctx), "system_info": modify_system_info(blender_system_info), "device_info": modify_device_info(blender_device_info), - "scenes": all_stats if all_stats else {} + "scenes": all_stats if all_stats else {}, + "benchmark_client": benchmark_client_info(), }) with G.progress_lock: diff --git a/benchmark/submission/client.py b/benchmark/submission/client.py index e0e752c..9e50924 100644 --- a/benchmark/submission/client.py +++ b/benchmark/submission/client.py @@ -11,6 +11,11 @@ from . import timeouts, exceptions, sockutil log = logging.getLogger(__name__) +# At this moment the Benchmark Client and the Benchmark Farm (farm.py) +# output different JSON schemas. +# TODO(Sybren): unify the JSON schemas and also update parse_results.py for this. +BENCHMARK_SCHEMA_VERSION = 1 + class SubmissionResult: """Metadata of the submitted benchmark. @@ -160,7 +165,7 @@ class BenchmarkClient: payload = { 'data': benchmark_data, - 'schema_version': 0, + 'schema_version': BENCHMARK_SCHEMA_VERSION, } log.info('Submitting benchmark to %s:\n%s', self.url_submit, json.dumps(payload, sort_keys=True, indent=4))