Formats heatmap for UI.
(self, filename, heatmap, execution_count)
| 174 | return base_profiler.run_in_separate_process(self._profile_package) |
| 175 | |
| 176 | def _format_heatmap(self, filename, heatmap, execution_count): |
| 177 | """Formats heatmap for UI.""" |
| 178 | with open(filename) as src_file: |
| 179 | file_source = src_file.read().split('\n') |
| 180 | skip_map = self._calc_skips(heatmap, len(file_source)) |
| 181 | run_time = sum(time for time in heatmap.values()) |
| 182 | return { |
| 183 | 'name': filename, |
| 184 | 'heatmap': heatmap, |
| 185 | 'executionCount': execution_count, |
| 186 | 'srcCode': self._skip_lines(file_source, skip_map), |
| 187 | 'runTime': run_time |
| 188 | } |
| 189 | |
| 190 | def _profile_module(self): |
| 191 | """Calculates heatmap for a module.""" |
no test coverage detected