Skip to content

Implement ProfilerSession with flame-graph-compatible timing output #849

Description

@Kingsman-99

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). 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 flame-graph-compatible JSON (speedscope format v0.6)
  • session.exportJSON(path): writes the report to a file
  • Tracks: method name, start time (ms), duration (ms), success/failure, nested RPC call timings
  • Tests asserting report structure matches speedscope schema
  • Runnable example script examples/profile-session.ts

Acceptance Criteria

  • ProfilerSession captures all SDK method timings
  • Output matches speedscope v0.6 JSON schema (validated with ajv)
  • exportJSON writes valid file
  • Example script runs against mock RPC
  • npm test passes with zero failures
  • TypeScript compiles with zero errors
  • ESLint passes with zero errors

Definition of Done

All CI checks must pass before the PR is reviewed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programcomplexity: highdxDeveloper experience and tooling

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions