How it works
The plugin orchestrates the full profiling loop on your behalf. You describe the problem; Metreja instruments your app, captures a trace, and hands the analysis back to the agent.
Tell the agent what's slow, what's allocating too much, or what you want to compare.
Metreja creates an isolated session config with the right filters for your codebase.
The profiler DLL attaches to your .NET runtime and captures method-level timing and allocation events.
The agent reads the NDJSON output and identifies hotspots, call trees, or memory pressure.
The agent explains the root cause and suggests a concrete code change, backed by numbers.
Run again, diff the traces. The agent confirms whether the change actually helped.
Why Metreja
The CLI profiles, captures, and aggregates. Your agent or script decides what it means. No built-in recommendations, no 'this is slow because…' logic.
Self-time analysis pinpoints the method that's actually slow, not the one that calls it. No more chasing callers up the stack.
Diff two traces. See the numbers change. No guessing whether your change helped — analyze-diff gives you hard evidence.
metreja check compares two traces and exits non-zero when a method regresses beyond your threshold. Drop it into any pipeline.
Filter by assembly, namespace, or class. Framework noise stays out, overhead stays low. Signal, not noise.
Every command returns machine-readable results that agents consume directly. No screenshots, no interactive sessions.
Rank exception types by frequency with throw-site methods. Find noisy exception paths before they become latency.
Per-thread call counts and activity windows, plus a chronological event timeline with method and type filtering.
Native profiler dylib for Apple Silicon alongside the Windows x64 DLL. Same CLI, same output format, both platforms.
Under the hood
The plugin orchestrates five commands. Every output is machine-readable NDJSON — designed to be consumed by an agent, not a human. You can also run the CLI directly if you need to.
| Command | What it does |
|---|---|
| metreja hotspots | Rank methods by self time, inclusive time, call count, or allocations |
| metreja calltree | Expand a slow method into its full call tree with timing at every level |
| metreja callers | Find who calls a method and how much time each caller contributes |
| metreja memory | GC counts by generation, pause times, per-type allocation hotspots |
| metreja analyze-diff | Compare two traces to verify a fix actually improved performance |
| metreja summary | Trace overview: event counts, wall-clock duration, threads, methods |
| metreja exceptions | Rank exception types by frequency with throw-site methods |
| metreja timeline | Chronological event listing with tid, event type, and method filtering |
| metreja threads | Per-thread breakdown: call counts, root time, activity windows |
| metreja trend | Method performance trend across periodic stats flush intervals |
| metreja check | CI regression gate: compare two traces, exit non-zero on regression |
| metreja run | Launch an executable with profiler attached (--detach for GUI apps) |
| metreja flush | Trigger manual stats flush on a running profiled process |
| metreja list | List existing profiling sessions |
| metreja merge | Combine multiple trace files into one sorted by timestamp |
| metreja export | Convert traces to speedscope or CSV format for visualization/analysis |
Coming soon
The core CLI profiler stays free and open-source. We're building cloud-based dashboards and CI/CD performance gates on top of it. Join the waitlist to get early access and help us prioritise what matters most.