-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Store benchmark metadata data in results.json
#63
base: master
Are you sure you want to change the base?
Store benchmark metadata data in results.json
#63
Conversation
CodSpeed Performance ReportMerging #63 will create unknown performance changesComparing Summary
Benchmarks breakdown
|
Use json reprensation as benchmark identifier in valgrind instrumentation
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it essential to inherit here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That way we do not have to define the properties twice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant It's weird to inherit from a metadata class
Add
results.json
file containing benchmark metadata for all instruments, and update the valgrind trigger to contain all the metadata.