Append-only CSV log of bench probe snapshots.
Format:
ts_ms,elapsed_sec,reachability,app_process,usb,screen,battery_pct,reasonReading:
ts_msis monotonic — safe to subtract for intervalselapsed_secis seconds since the run started (set onopen/2)reachability,app_process,usb,screenare atoms (string-encoded)battery_pctis integer or emptyreasonis a string (CSV-escaped)
Use summary/1 after a run to compute % success, gap distribution,
reconnect count, etc.
Summary
Functions
Append a probe snapshot. Returns the updated logger struct.
Close the log file. Idempotent.
Open a log file for writing. Creates parent dirs as needed.
Read a CSV file and return a list of probe-like maps. Useful for tests
and for summary/1.
Types
@type t() :: %MobDev.Bench.Logger{ file: File.io_device() | nil, path: Path.t(), rows: non_neg_integer(), start_ts_ms: integer() }
Functions
@spec append(t(), MobDev.Bench.Probe.t()) :: t()
Append a probe snapshot. Returns the updated logger struct.
Close the log file. Idempotent.
Open a log file for writing. Creates parent dirs as needed.
Returns a struct that's passed to subsequent append/2 and close/1 calls.
Read a CSV file and return a list of probe-like maps. Useful for tests
and for summary/1.
Each row is %{ts_ms, elapsed_sec, reachability, app_process, usb, screen, battery_pct, reason} with atoms restored.