carlos / platform Public

analytics-live: walk the live door in the perf budget

The perf walk times GET .../analytics/live for the tab and the card. A
repeat call makes 2 S3 calls (both telemetry settings, read every refresh
so turning analytics on shows at once; the counts come from the traffic
memo), recorded in perf-budgets.txt (about 50 ms).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 44e9ecb1b8717be755e7e145a488764b0c6d4182 parent bf74c53
2 files changed, +7 −0
  • internal/console/perfwalk_test.go +6 −0
  • internal/console/testdata/perf-budgets.txt +1 −0

CI failed — run details

diff --git a/internal/console/perfwalk_test.go b/internal/console/perfwalk_test.go
index b1a9336b5..c2bbe75a8 100644
--- a/internal/console/perfwalk_test.go
+++ b/internal/console/perfwalk_test.go
@@ -518,6 +518,12 @@ func perfTargets(fx *consoleFixture) map[string][]perfTarget {
"instances", "logs", "logs/data", "settings"} {
m["GET /a/{sqid}/apps/{app}/"+tab] = ok(app + "/" + tab)
}
+ // The live door (analyticslive.go): the tab's numbers part and the
+ // Overview card's, each read through the traffic memo.
+ m["GET /a/{sqid}/apps/{app}/analytics/live"] = []perfTarget{
+ {Path: app + "/analytics/live?view=tab&range=7d", Expect: http.StatusOK},
+ {Path: app + "/analytics/live?view=card", Expect: http.StatusOK},
+ }
// /deployments is a 303 to Releases; the fixture's page 2 of Versions is
// the empty-page state, which still runs the listing.
m["GET /a/{sqid}/apps/{app}/deployments"] = []perfTarget{{Path: app + "/deployments", Expect: http.StatusSeeOther}}
diff --git a/internal/console/testdata/perf-budgets.txt b/internal/console/testdata/perf-budgets.txt
index 6443fbadd..a2b47649e 100644
--- a/internal/console/testdata/perf-budgets.txt
+++ b/internal/console/testdata/perf-budgets.txt
@@ -63,6 +63,7 @@ GET /a/{sqid}/apps/{app}/logs/data deferred: deferred part (the Logs tab's data
# (appframe.go); the account manifest is read once per process. A cold view
# (perfColdReset) reads both: 7 S3 calls, about 80 ms.
/fleet/architecture calls 12: reads economics/active.json, infra/inventory.json and status/fleet.json, and lists and reads every box report (12 S3 calls warm and cold, about 390 ms)
+GET /a/{sqid}/apps/{app}/analytics/live calls 2: the live door the Analytics tab and Overview card refresh from once a minute: both telemetry settings, read on every refresh so an owner turning analytics on sees it at once; the window's counts come from the traffic memo, read at most once a minute per app and view (about 50 ms)
GET /a/{sqid}/apps/{app}/analytics calls 4: both telemetry settings, the analytics day listing and one day read (about 105 ms); cold, also the app-tab frame and the account manifest (11 S3 calls, about 190 ms)
GET /a/{sqid}/apps/{app}/availability calls 10: both telemetry settings and three listings and a read each for the log and error chunks (about 265 ms); cold, also the app-tab frame and the account manifest (17 S3 calls, about 340 ms)
GET /a/{sqid}/apps/{app}/errors calls 10: both telemetry settings and three listings and a read each for the log and error chunks (about 265 ms); cold, also the app-tab frame and the account manifest (17 S3 calls, about 340 ms)