Skip to content

chore: rename trackLatency to trackDuration on LDGraphTracker#1285

Open
jsonbailey wants to merge 2 commits intofeat/ai-sdk-next-releasefrom
jb/aic-2245/graph-track-duration-align
Open

chore: rename trackLatency to trackDuration on LDGraphTracker#1285
jsonbailey wants to merge 2 commits intofeat/ai-sdk-next-releasefrom
jb/aic-2245/graph-track-duration-align

Conversation

@jsonbailey
Copy link
Copy Markdown
Contributor

@jsonbailey jsonbailey commented Apr 16, 2026

Summary

  • Renames trackLatency()trackDuration() on the LDGraphTracker interface and LDGraphTrackerImpl class to align with the existing trackDuration naming on LDAIConfigTracker
  • Updates the event key from $ld:ai:graph:latency to $ld:ai:graph:duration:total per the updated AIGRAPHTRACK spec
  • Updates all tests to match the new method name and event key

Test plan

  • All 144 unit tests pass (yarn workspace @launchdarkly/server-sdk-ai test)
  • Lint passes clean
  • Build succeeds

🤖 Generated with Claude Code


Note

Medium Risk
This is a public API rename and event-key change that can break downstream consumers and dashboards if they still call trackLatency or rely on the old $ld:ai:graph:latency metric name.

Overview
Renames the LDGraphTracker API from trackLatency() to trackDuration() and updates LDGraphTrackerImpl and unit tests accordingly.

Changes the emitted metric event key from $ld:ai:graph:latency to $ld:ai:graph:duration:total while preserving the existing at-most-once semantics and summary reporting via durationMs.

Reviewed by Cursor Bugbot for commit cfb4846. Bugbot is set up for automated code reviews on this repo. Configure here.

… event key to $ld:ai:duration:total

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 25623 bytes
Compressed size limit: 29000
Uncompressed size: 125843 bytes

@github-actions
Copy link
Copy Markdown
Contributor

@launchdarkly/js-client-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 37169 bytes
Compressed size limit: 38000
Uncompressed size: 204305 bytes

@github-actions
Copy link
Copy Markdown
Contributor

@launchdarkly/browser size report
This is the brotli compressed size of the ESM build.
Compressed size: 179375 bytes
Compressed size limit: 200000
Uncompressed size: 829982 bytes

@github-actions
Copy link
Copy Markdown
Contributor

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Compressed size: 31655 bytes
Compressed size limit: 34000
Uncompressed size: 112792 bytes

@jsonbailey jsonbailey marked this pull request as ready for review April 16, 2026 18:12
@jsonbailey jsonbailey requested a review from a team as a code owner April 16, 2026 18:12
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit cfb4846. Configure here.

Comment thread packages/sdk/server-ai/src/LDGraphTrackerImpl.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants