|
@@ 164-182 (lines=19) @@
|
| 161 |
|
fh.write(safe_dumps(output_json, ensure_ascii=True, indent=4).encode()) |
| 162 |
|
self.logger.info("Wrote benchmark data in: %s" % self.json, purple=True) |
| 163 |
|
|
| 164 |
|
if save: |
| 165 |
|
output_json = self.config.hook.pytest_benchmark_generate_json( |
| 166 |
|
config=self.config, |
| 167 |
|
benchmarks=self.benchmarks, |
| 168 |
|
include_data=self.save_data, |
| 169 |
|
machine_info=self.machine_info, |
| 170 |
|
commit_info=commit_info, |
| 171 |
|
) |
| 172 |
|
self.config.hook.pytest_benchmark_update_json( |
| 173 |
|
config=self.config, |
| 174 |
|
benchmarks=self.benchmarks, |
| 175 |
|
output_json=output_json, |
| 176 |
|
) |
| 177 |
|
output_file = self.storage.get("%s_%s.json" % (self.next_num, save)) |
| 178 |
|
assert not output_file.exists() |
| 179 |
|
|
| 180 |
|
with output_file.open('wb') as fh: |
| 181 |
|
fh.write(safe_dumps(output_json, ensure_ascii=True, indent=4).encode()) |
| 182 |
|
self.logger.info("Saved benchmark data in: %s" % output_file) |
| 183 |
|
|
| 184 |
|
def handle_loading(self): |
| 185 |
|
self.compared_mapping = {} |
|
@@ 147-162 (lines=16) @@
|
| 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 |
|
) |
| 155 |
|
self.config.hook.pytest_benchmark_update_json( |
| 156 |
|
config=self.config, |
| 157 |
|
benchmarks=self.benchmarks, |
| 158 |
|
output_json=output_json, |
| 159 |
|
) |
| 160 |
|
with self.json as fh: |
| 161 |
|
fh.write(safe_dumps(output_json, ensure_ascii=True, indent=4).encode()) |
| 162 |
|
self.logger.info("Wrote benchmark data in: %s" % self.json, purple=True) |
| 163 |
|
|
| 164 |
|
if save: |
| 165 |
|
output_json = self.config.hook.pytest_benchmark_generate_json( |