Merged
Conversation
6e25da0 to
9612cdd
Compare
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Add implementation plan for useLensPerformanceMetrics hook Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> test: add failing tests for useLensPerformanceMetrics hook Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> fix: resolve TypeScript errors in useLensPerformanceMetrics tests Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> fix: align test mock shapes with actual SDK types Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> feat: implement useLensPerformanceMetrics hook Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> fix: reset isFirstLensRender on session cleanup Prevents spurious measurement.reset() call on the first lens applied to a new session after re-bootstrap. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> feat: export useLensPerformanceMetrics and ComputedFrameMetrics type Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> feat: add enabled option to useLensPerformanceMetrics Allows consumers to conditionally enable/disable measurement without breaking rules of hooks. Defaults to true. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> fix: remove ComputedFrameMetrics re-export from index Consumers should import SDK types directly from @snap/camera-kit, consistent with how other SDK types (Lens, LensLaunchData, etc.) are not re-exported. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> docs: add useLensPerformanceMetrics to README Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> refactor: rename useLensPerformanceMetrics to useLensFrameMetrics Aligns with the SDK's ComputedFrameMetrics return type and is more specific about what is being measured. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> chore: remove design and plan docs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> refactor: remove lens cache fix from this branch The lens cache clearing on re-bootstrap will go in a separate PR. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
9612cdd to
d043cf4
Compare
jciereszko-sc
previously approved these changes
Apr 3, 2026
Changing the polling interval no longer restarts the measurement and discards accumulated stats. The measurement lifecycle is now keyed only on session/enabled, while the polling interval is managed in a separate effect. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ad1d130 to
aca3a43
Compare
jciereszko-sc
approved these changes
Apr 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
useLensFrameMetricshook that exposes lens rendering performance data (ComputedFrameMetrics) from the CameraKit SDK'ssession.metricsAPILensPerformanceMeasurementlifecycle: begins measurement when a session is available, polls at a configurable interval, resets on lens change, and callsend()on cleanup to prevent memory leaksenabledoption (defaults totrue) so consumers can toggle measurement without breaking rules of hooksUsage
Test plan
undefinedwhen no session