EngFlow / bazel_invocation_analyzer

A tool that automatically analyzes a Bazel build's profile and offers suggestions on how to make it faster.
https://analyzer.engflow.com
Apache License 2.0
91 stars 10 forks source link

[DataProvider] Add provider for metrics on caching status and execution location #138

Closed saraadams closed 11 months ago

saraadams commented 11 months ago

This data provider scans all actions and splits them into:

as well as (for non-cache-hits):

"Internal" Bazel actions are included in "remote cache not checked" and "execution location not reported". While I invested ample time in trying to single internal actions out reliably, I did not succeed. I'm not sure it's possible with the information currently written to profiles. A TODO to look into separating out "internal" actions is in the code.

Contributes to #90

saraadams commented 11 months ago

Example output:

CachingAndExecutionMetrics: Metrics on the processed actions' caching and execution status.
Actions: ____________________________ 18121
    Remote cache hits: ______________ 12905     71,22% of all actions
    Remote cache misses: ____________    12      0,07% of all actions
        Executed locally:                 2     16,67% of all cache misses
        Executed remotely:               10     83,33% of all cache misses
        Not reported:                     0      0,00% of all cache misses
    Remote cache not checked: _______  5204     28,72% of all actions
        Executed locally:               824     15,83% of all cache skips
        Executed remotely:                0      0,00% of all cache skips
        Not reported (e.g. internal):  4380     84,17% of all cache skips

    Executed locally: _______________   826      4,56% of all actions
    Executed remotely: ______________    10      0,06% of all actions
    Execution not reported: _________ 17285     95,39% of all actions