Overview
Build out the ProfilerSession class to capture real timings for all SDK operations and produce output compatible with the speedscope flame graph viewer (JSON format). This is essential for diagnosing SDK performance bottlenecks in production.
Requirements
ProfilerSession wraps a StellarSplitClient and records timing for every method call
session.start() / session.stop() controls recording
session.report(): SpeedscopeProfile returns a flame-graph-compatible JSON object (speedscope format v0.6)
session.exportJSON(path: string): void writes the report to a file
- Tracks: method name, start time (ms), duration (ms), success/failure, nested RPC call timings
- Write tests asserting the report structure matches the speedscope schema (validated with
ajv)
- Include a runnable example script (
examples/profile-session.ts)
Acceptance Criteria
Definition of Done
All CI checks must pass before the PR is reviewed.
Overview
Build out the
ProfilerSessionclass to capture real timings for all SDK operations and produce output compatible with thespeedscopeflame graph viewer (JSON format). This is essential for diagnosing SDK performance bottlenecks in production.Requirements
ProfilerSessionwraps aStellarSplitClientand records timing for every method callsession.start()/session.stop()controls recordingsession.report(): SpeedscopeProfilereturns a flame-graph-compatible JSON object (speedscope format v0.6)session.exportJSON(path: string): voidwrites the report to a fileajv)examples/profile-session.ts)Acceptance Criteria
ProfilerSessioncaptures all SDK method timingsexportJSONwrites a valid filenpm testpasses with zero failuresDefinition of Done
All CI checks must pass before the PR is reviewed.