|
@@ 153-166 (lines=14) @@
|
| 150 |
|
benchmarks=self.benchmarks, |
| 151 |
|
include_data=True, |
| 152 |
|
machine_info=self.machine_info, |
| 153 |
|
commit_info=commit_info, |
| 154 |
|
) |
| 155 |
|
self.config.hook.pytest_benchmark_update_json( |
| 156 |
|
config=self.config, |
| 157 |
|
benchmarks=self.benchmarks, |
| 158 |
|
output_json=output_json, |
| 159 |
|
) |
| 160 |
|
self.save_json(output_json) |
| 161 |
|
|
| 162 |
|
if save: |
| 163 |
|
output_json = self.config.hook.pytest_benchmark_generate_json( |
| 164 |
|
config=self.config, |
| 165 |
|
benchmarks=self.benchmarks, |
| 166 |
|
include_data=self.save_data, |
| 167 |
|
machine_info=self.machine_info, |
| 168 |
|
commit_info=commit_info, |
| 169 |
|
) |
|
@@ 138-151 (lines=14) @@
|
| 135 |
|
fh.write(safe_dumps(output_json, ensure_ascii=True, indent=4).encode()) |
| 136 |
|
self.logger.info("Wrote benchmark data in: %s" % self.json, purple=True) |
| 137 |
|
|
| 138 |
|
def handle_saving(self): |
| 139 |
|
save = self.save or self.autosave |
| 140 |
|
if save or self.json: |
| 141 |
|
if not self.benchmarks: |
| 142 |
|
self.logger.warn("BENCHMARK-U2", "Not saving anything, no benchmarks have been run!") |
| 143 |
|
return |
| 144 |
|
commit_info = self.config.hook.pytest_benchmark_generate_commit_info(config=self.config) |
| 145 |
|
self.config.hook.pytest_benchmark_update_commit_info(config=self.config, commit_info=commit_info) |
| 146 |
|
|
| 147 |
|
if self.json: |
| 148 |
|
output_json = self.config.hook.pytest_benchmark_generate_json( |
| 149 |
|
config=self.config, |
| 150 |
|
benchmarks=self.benchmarks, |
| 151 |
|
include_data=True, |
| 152 |
|
machine_info=self.machine_info, |
| 153 |
|
commit_info=commit_info, |
| 154 |
|
) |