perfSessionBeginHook top-level property
Command that opens a measurement session in the packages dusk cannot import: it zeroes wind's counters and telescope's frame buffer, and turns wind's counting ON.
The enabling half is not incidental. WindPerfCounters.enabled defaults to
false and lives in fluttersdk_wind, which dusk does not depend on and
cannot reach: dusk sees wind only through
fluttersdk_wind_diagnostics_contracts, and the contract exposes stats()
and nothing that could flip a flag. So without this hook doing it,
ext.dusk.perf_begin would produce a report whose wind section reads all
zeros while every other section is populated, with no error anywhere to say
why. Zeroing without enabling is the same bug wearing a tidier name.
Defaults to a no-op: a host without the perf integration wired has nothing to open.
Hosts wire the real thing by writing:
perfSessionBeginHook = () {
WindPerfCounters.reset();
WindPerfCounters.enabled = true;
TelescopeStore.clearFramePerf();
};
Contract: set-once-per-isolate from MagicPerfIntegration.install().
Reset to this no-op default by MagicPerfIntegration.resetForTesting().
Always paired with perfSessionEndHook; see there for why.
Implementation
void Function() perfSessionBeginHook = () {};