Get a summary of all build times
(self)
| 81 | self.logger(f" {component_name} ({platform}) completed in {duration:.2f} s") |
| 82 | |
| 83 | def get_summary(self): |
| 84 | """Get a summary of all build times""" |
| 85 | summary = { |
| 86 | 'build_session': { |
| 87 | 'start_time': min(self.start_times.values()) if self.start_times else None, |
| 88 | 'end_time': max(self.end_times.values()) if self.end_times else None, |
| 89 | 'total_duration': sum(cmd['duration'] for cmd in self.command_times.values()) if self.command_times else 0, |
| 90 | 'timestamp': datetime.now().isoformat() |
| 91 | }, |
| 92 | 'commands': self.command_times, |
| 93 | 'components': self.component_times |
| 94 | } |
| 95 | |
| 96 | # Calculate component totals |
| 97 | component_totals = {} |
| 98 | for component, platforms in self.component_times.items(): |
| 99 | total_duration = sum(platform_data['duration'] for platform_data in platforms.values()) |
| 100 | component_totals[component] = { |
| 101 | 'total_duration': total_duration, |
| 102 | 'platforms': len(platforms), |
| 103 | 'average_per_platform': total_duration / len(platforms) if platforms else 0 |
| 104 | } |
| 105 | |
| 106 | summary['component_totals'] = component_totals |
| 107 | return summary |
| 108 | |
| 109 | def save_times(self, filename=None): |
| 110 | """Save build times to JSON file""" |
no test coverage detected