MobDev.OtpTrace.Harness (mob_dev v0.3.37)

Copy Markdown View Source

Characterization harness: a curated set of Elixir features exercised in tight blocks. Designed to be wrapped in MobDev.OtpTrace.capture/1 to record the runtime modules touched by typical Elixir code.

Phases

Run individually or together. Each phase exercises a coherent slice so the trace can be partitioned into "what does X actually need."

  • language/0 — pattern match, comprehension, anonymous fns,
                  struct + protocol dispatch, exception handling
  • collections/0 — Enum, Stream, List, Map, MapSet, Tuple, Range
  • strings/0 — String, Binary, charlist conversion, sigils
  • processes/0 — spawn, send/receive, monitor, link
  • otp/0 — GenServer, Supervisor, Application boot, Logger
  • data/0 — ETS, :persistent_term, Date/Time
  • errors/0 — raise, rescue, throw/catch, exit/trap_exit
  • all/0 — runs everything sequentially

What this is NOT

  • Not a benchmark — timings are meaningless under trace overhead
  • Not exhaustive — covers common Elixir, not every language corner
  • Not production-safe — runs :erlang.trace/3 system-wide

How modules are defined

Modules used by the harness are defined at compile time of THIS module, NOT inside the traced functions. That's deliberate: tracing inside a defmodule block captures the entire compiler call graph (~80 modules of :elixir_*, :erl_lint, :sys_core_*). Production apps don't run the compiler at runtime, so we exclude that surface from the baseline.

Summary

Functions

all()

collections()

data()

errors()

language()

otp()

processes()

strings()