Store benchmark metadata data in results.json#63
Store benchmark metadata data in results.json#63adriencaccia wants to merge 4 commits intomasterfrom
results.json#63Conversation
CodSpeed Instrumentation Performance ReportMerging #63 will create unknown performance changesComparing Summary
Benchmarks breakdown
|
fbae262 to
1ad4aa9
Compare
results.json
| @property | ||
| def display_name(self) -> str: | ||
| if len(self.args) == 0: | ||
| args_str = "" | ||
| else: | ||
| arg_blocks = [] | ||
| for i, (arg_name, arg_value) in enumerate(zip(self.args_names, self.args)): | ||
| arg_blocks.append(arg_to_str(arg_value, arg_name, i)) | ||
| args_str = f"[{'-'.join(arg_blocks)}]" | ||
|
|
||
| return f"{self.name}{args_str}" | ||
|
|
||
| def to_json_string(self) -> str: | ||
| return json.dumps( | ||
| self.__dict__, default=vars, separators=(",", ":"), sort_keys=True | ||
| ) | ||
|
|
||
|
|
||
| def arg_to_str(arg: Any, arg_name: str, index: int) -> str: | ||
| if type(arg) in [int, float, str]: | ||
| return str(arg) | ||
| if ( | ||
| arg is not None | ||
| and type(arg) not in [list, dict, tuple] | ||
| and hasattr(arg, "__str__") | ||
| ): | ||
| return str(arg) | ||
| return f"{arg_name}{index}" |
There was a problem hiding this comment.
Before merging, we need to make sure we know the difference with the display name computation from pytest itself (and the potential impact)
|
|
||
| config: BenchmarkConfig | ||
| stats: BenchmarkStats | ||
| class WalltimeBenchmark(Benchmark): |
There was a problem hiding this comment.
is it essential to inherit here?
There was a problem hiding this comment.
That way we do not have to define the properties twice
There was a problem hiding this comment.
I meant It's weird to inherit from a metadata class
There was a problem hiding this comment.
Seen together, let's do composition instead of inheritance, by having a new field benchmark_metadata: BenchmarkMetadata
Use json reprensation as benchmark identifier in valgrind instrumentation
1ad4aa9 to
ef62849
Compare
Add
results.jsonfile containing benchmark metadata for all instruments, and update the valgrind trigger to contain all the metadata.