Calculates heatmap for a package.
(self)
| 148 | return code_with_skips |
| 149 | |
| 150 | def _profile_package(self): |
| 151 | """Calculates heatmap for a package.""" |
| 152 | with _CodeHeatmapCalculator() as prof: |
| 153 | try: |
| 154 | runpy.run_path(self._run_object, run_name='__main__') |
| 155 | except SystemExit: |
| 156 | pass |
| 157 | |
| 158 | heatmaps = [] |
| 159 | for filename, heatmap in prof.heatmap.items(): |
| 160 | if os.path.isfile(filename): |
| 161 | heatmaps.append( |
| 162 | self._format_heatmap( |
| 163 | filename, heatmap, prof.execution_count[filename])) |
| 164 | |
| 165 | run_time = sum(heatmap['runTime'] for heatmap in heatmaps) |
| 166 | return { |
| 167 | 'objectName': self._run_object, |
| 168 | 'runTime': run_time, |
| 169 | 'heatmaps': heatmaps |
| 170 | } |
| 171 | |
| 172 | def profile_package(self): |
| 173 | """Runs package profiler in a separate process.""" |
nothing calls this directly
no test coverage detected