feat: Report coverage latency in shield metrics #7133
Merged
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.
Explanation
This PR adds latency reporting to shield coverage and signature coverage results. The latency (in milliseconds) is included as part of the
metricsproperty in each coverage response, allowing downstream consumers and analytics systems to track and analyze the performance of coverage checks.Unit tests have been updated to verify correct latency values in the metrics.
Changes
metrics.latencyto coverage and signature coverage responses.Date.now()for latency measurements.References
Fixes https://github.com/MetaMask/MetaMask-planning/issues/6136
Checklist
Note
Add
metrics.latencyto coverage and signature coverage responses, measuring end-to-end latency (including retries) and update tests and changelog accordingly.metrics.latencytoGetCoverageResultResponseandCoverageResultreturned byShieldRemoteBackend.#getCoverageResultusingDate.now(), including retries/delays via polling policy.CoverageResultandGetCoverageResultResponsewithmetrics.latencyinsrc/types.tsandsrc/backend.ts.src/backend.test.tsto assert presence and correctness ofmetrics.latencyfor both transaction and signature coverage, including retry-delay scenarios.packages/shield-controller/CHANGELOG.md.Written by Cursor Bugbot for commit fc9d432. This will update automatically on new commits. Configure here.