Which of the project's functions a job executed (design notes §7.3): the footprint a cached kill rests on.
Recorded with call-count tracing in a trace session of its own
(docs/dependencies/trace-call-count.md), so it never touches the default session a
test may use, and no process needs trace flags. The first measured job of a worker
loads every module of the project's applications whose source is under the worker's
directory (the sandbox), and turns call counting on for each, once; every measured job
then sets the counters to zero, runs, and reads the functions whose count rose.
A function whose counting is off when read (its module was loaded again during the
job) makes the footprint :incomplete: the controller then records no cache entry,
never one resting on part of what ran.
This module runs inside workers and is never mutated.
Summary
Functions
Turns call counting on for modules (those with a source under the current directory)
once per VM, and returns the armed state: the session and every function counted.
Arms call counting for the project's applications (Juggernaut.Peer.Boot.state/0)
and returns :ok; a no-op once armed. The worker calls it before a measured job.
Ends counting and forgets the armed state (for tests).
Runs fun and returns {its result, the footprint} when measure?, else
{its result, nil}. The footprint is a list of {source, module, fun, arity} (sources
relative to the current directory) or :incomplete. apps are the project's
applications.
The loaded modules of apps whose source is under the current directory.
Types
Functions
Turns call counting on for modules (those with a source under the current directory)
once per VM, and returns the armed state: the session and every function counted.
@spec arm_apps() :: :ok
Arms call counting for the project's applications (Juggernaut.Peer.Boot.state/0)
and returns :ok; a no-op once armed. The worker calls it before a measured job.
@spec disarm() :: :ok
Ends counting and forgets the armed state (for tests).
@spec measure(boolean(), [atom()], (-> result)) :: {result, [function_ref()] | :incomplete | nil} when result: term()
Runs fun and returns {its result, the footprint} when measure?, else
{its result, nil}. The footprint is a list of {source, module, fun, arity} (sources
relative to the current directory) or :incomplete. apps are the project's
applications.
The loaded modules of apps whose source is under the current directory.