Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0b7bdeeb authored by Liz Kammer's avatar Liz Kammer
Browse files

Store metrics for each run of a benchmark.

Enables a breakdown to understand where time is being spent on each CUJ.

Test: run ./build/make/tools/perf/benchmarks --store-metrics
Change-Id: I28f3f62b2b2c1fd810ecce9238c7177c1eb382d7
parent efb6650d
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -368,6 +368,7 @@ class Runner():
                # If we're disting just one benchmark, save the logs and we can stop here.
                self._dist(utils.get_dist_dir(), benchmark.dumpvars)
            else:
                self._dist(benchmark_log_dir, benchmark.dumpvars, store_metrics_only=True)
                # Postroll builds
                for i in range(benchmark.postroll):
                    ns = self._run_build(lunch, benchmark_log_dir.joinpath(f"post_{i}"),
@@ -418,16 +419,19 @@ class Runner():

        return after_ns - before_ns

    def _dist(self, dist_dir, dumpvars):
    def _dist(self, dist_dir, dumpvars, store_metrics_only=False):
        out_dir = utils.get_out_dir()
        dest_dir = dist_dir.joinpath("logs")
        os.makedirs(dest_dir, exist_ok=True)
        basenames = [
            "build.trace.gz",
            "soong.log",
            "soong_build_metrics.pb",
            "soong_metrics",
        ]
        if not store_metrics_only:
            basenames.extend([
                "build.trace.gz",
                "soong.log",
            ])
        if dumpvars:
            basenames = ['dumpvars-'+b for b in basenames]
        for base in basenames: