Skip to content

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

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). 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

  • ProfilerSession captures all SDK method timings
  • Output matches speedscope v0.6 JSON schema
  • exportJSON writes a valid file
  • Example script runs end-to-end against a 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.

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaignOfficial Campaign | FWC26Campaign: Official Campaign | FWC26complexity: highdxDeveloper experience and toolinggrantfoxIssue for GrantFox program

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions