Repository navigation
feat(latency): fetch real latency series via latencyApi and remove fa… - #1487
Open
digofavour-hub wants to merge 1 commit into
Open
digofavour-hub wants to merge 1 commit into
digofavour-hub wants to merge 1 commit into
Conversation
|
@digofavour-hub Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Closes #1411
Summary
src/api/latencyApi.tsexportingfetchLatencySeries({ apiId, range, signal })routed throughauthFetch(with the endpoint path isolated inbuildLatencyPath), strict response/point validation intoLatencyPoint[], error mapping (401/HTTP/network/invalid JSON/abort), and demo-mode sample data fallback whenAPI_BASEis empty.useLatencyDatainsrc/pages/LatencyChart.tsxto callfetchLatencySerieswith anAbortController, preserving the generation guard,isStale, andretrybehaviour while removingLOADING_DELAY_MSand allsetTimeoutfake loading.?api=<id>from URL search params inLatencyChartwith a clear "No API Selected" empty state when a backend is configured and no API is selected.p95when present in the response, falling back tocomputeStats.API_BASEis empty.docs/Deployment.mdfixture matrix with the Latency chart row.Testing
src/api/latencyApi.test.ts(13 tests) covering point/response validation, malformed points, non-numeric values, empty series, 401/500/network/invalid JSON/abort handling, and demo mode detection.src/pages/LatencyChart.test.tsx(15 tests) removing the../config/constantsmock and mocking../api/latencyApi, covering?api=query param reading, empty state, demo mode badge, serverp95, single-point series, stale state, retry, unmount abort, and out-of-order race-condition guard.npm test -- --run src/pages/LatencyChart.test.tsx src/api/latencyApi.test.ts src/utils/downsample.test.ts(30/30 passing).