Post-run analysis of a bench CSV log.
Reads a MobDev.Bench.Logger CSV and produces a summary map with
metrics that tell you whether the bench measurement is trustworthy:
total_samples— how many polls completedsuccessful_samples— those that produced a battery readingsuccess_rate— fraction (0.0..1.0)reconnect_count— number of times we transitioned :unreachable / :alive_*_only → :alive_rpclongest_gap_sec— longest interval between successful battery readsstate_durations— total time (sec) spent in each reachability statescreen_off_duration_sec— time the screen was offscreen_on_duration_sec— time the screen was onstart_battery,end_battery,drain_pct— first and last successful readseffective_rate_pct_per_hour— drain extrapolated to per-hour
Summary
Functions
Compute summary metrics for a bench CSV.
Compute summary metrics from already-parsed rows. Useful for tests.
Render a summary as a human-readable multi-line string.
Types
@type metrics() :: %{ total_samples: non_neg_integer(), successful_samples: non_neg_integer(), success_rate: float(), reconnect_count: non_neg_integer(), longest_gap_sec: float(), state_durations: %{required(atom()) => float()}, screen_off_duration_sec: float(), screen_on_duration_sec: float(), start_battery: integer() | nil, end_battery: integer() | nil, drain_pct: integer() | nil, effective_rate_pct_per_hour: float() | nil, taint_warnings: [String.t()] }
Functions
Compute summary metrics for a bench CSV.
Compute summary metrics from already-parsed rows. Useful for tests.
Render a summary as a human-readable multi-line string.