Repository navigation
Add admin analytics for environment records and Agent sessions - #253
Merged
Merged
Conversation
Add recorded API lifetimes and estimated lifetimes for torn-down PR environments. Show unique components by repository and ready components across current environments. Keep missing measurements unavailable. Exclude incomplete identities from unique component counts.
The inventory query can reach its time limit as the number of current environments increases. Read the selected component rows once and keep their latest deployment state for the result. Counts and filters stay the same. Return HTTP503 with analytics_timeout when PostgreSQL confirms a statement time limit. Keep other failures unchanged and exclude database details from the response.
Count enabled optional components in current inventory. Add complete lifetime scatter data and current age groups. Add session summaries and exact session run filters.
Return repository groups for environment activity when requested. Keep date totals complete and existing responses unchanged by default.
Return complete names through the existing record and scatter responses. Describe record duration without implying deployed resources. Keep existing query counts and measurement limits.
Return null for invalid retained dates instead of failing inventory. Keep valid records and current phase counts available.
Return null for invalid queue and earliest run dates. Permit a null queue date without changing submission dates or counts.
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.
Administrators can review environment records, repository and PR activity, current health, components, and Agent session usage from retained Lifecycle data.
Environment activity supports repository stacks over time and previous-period comparisons. Up to five repositories remain separate. Other repositories and Unattributed preserve each date total. Creation counts include records that never deployed. PR record coverage measures linked records, not deployment adoption.
Unique components count each configured component once within its owning repository. Ready components count recorded READY components separately in each current environment. Current inventory and component totals ignore the date window.
API record duration uses creation and recorded deletion. PR record duration estimates use creation and last update for torn-down records. Both can include records that never deployed. PR estimates can include waiting time, later edits, and reuse gaps. Current record age has separate statistics. Records and scatter points return complete names. Scatter includes all measured points up to 5,000 records. Larger results request a narrower scope.
Agent session rows include all matching submissions before pagination. Each row shows runs, outcomes, tokens, recorded repositories, and separate reported and estimated costs. Run records support a session filter. Time windows select submission dates. Usage can include later execution.
Access requires administrator permission. Results support filters, comparisons, and paged records. Migration 036 adds an index for active deployment lookups. Repository stacks avoid per-repository scans. Each Analytics SQL statement has a 10-second limit. Confirmed timeouts return HTTP 503 with a retry action. Invalid retained dates return null without failing the inventory. Invalid Agent queue dates and an invalid earliest run date also return null. The queue date field permits null without changing submission dates or counts.
Validation: 9,651 API tests and 55 gateway tests passed. Eleven existing API tests remain skipped. Lint, runtime TypeScript, scoped formatting, and the normal production build passed. Actual SQL ran against temporary PostgreSQL fixtures with 200,000 environment records, 500,000 deployment records, and 50,000 Agent runs. All measured statements completed within their limit. Seventeen payloads passed schema validation. Ten checks confirmed related metric totals agree. Seven additional checks cover invalid dates and unchanged submission cohorts. These local measurements do not establish production capacity.
Commit and PR text review: passed against the project writing standard, final change, and validation evidence.
UI text review: passed for API text shown in Analytics. Record measures preserve their estimates and data limits.
Deploy this API before the UI analytics change.