Exemplo n.º 1
0
def process_subcommands(pods, profile, **_):
    """Handle flags that need to process after the sub command."""

    if not pods:
        return

    pod = pods[0]

    if profile:
        report = profile_report.ProfileReport(pod.profile)
        # report.pretty_print()
        destination = local_destination.LocalDestination(
            local_destination.Config())
        destination.pod = pod
        destination.export_profile_report()
Exemplo n.º 2
0
 def export_profile_report(self):
     """Write the results of the profiling timers."""
     report = profile_report.ProfileReport(self.pod.profile)
     file_name = '{}profile.json'.format(self.control_dir)
     self.pod.write_file(file_name, json.dumps(report.export()))
     logging.info('Profiling data exported to {}'.format(file_name))