Analyze leaks as a time series (xctrace Leaks instrument)
analyzeLeakTimelineParse a Leaks .trace file to get a timeline of leak events per class, showing first-seen timestamp, peak instance count, and peak bytes to identify when leaks appear in the recording.
Instructions
[mg.trace] Parse the leaks schema from a .trace recorded with a Leaks template. Distinct from leaks(1) CLI (snapshot): this is a time series of leak events captured throughout the recording. Returns per-class first-seen-at timestamp, peak instance count, peak bytes, event count. Useful for answering 'when in the timeline did the leak appear?' which the snapshot CLI cannot. v1.15+.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tracePath | Yes | Absolute path to a `.trace` bundle recorded with a Leaks template. | |
| topN | No | Return the top N leaked classes ranked by peak instance count (default 10). | |
| outputFormat | No | Response format. Omitted or `json` (default, preserves v1.8 behavior) returns JSON.stringify of the result. `markdown` renders a human-readable view of the same data. `both` returns both content items in one response, so a client can display markdown to the user and parse JSON for the agent loop without a second call. `verify-fix-table` (v1.10, applies to `analyzeAbandonedMemory` and `diffMemgraphs`) emits a focused 4-column markdown comparison table (Class | Before | After | Delta) of the actionable rows; other tools fall back to `markdown` for this value. |