MCPcopy Index your code
hub / github.com/coder/coder / GetPRInsightsSummary

Method GetPRInsightsSummary

coderd/database/querier.go:589–589  ·  view source on GitHub ↗

PR Insights queries for the /agents analytics dashboard. These aggregate data from chat_diff_statuses (PR metadata) joined with chats and chat_messages (cost) to power the PR Insights view. Cost is computed per PR by summing the PR-linked chat's own cost plus the costs of any direct children (subag

(ctx context.Context, arg GetPRInsightsSummaryParams)

Source from the content-addressed store, hash-verified

587 // direct children (that lack their own PR), and deduped picks one row
588 // per PR for state/additions/deletions.
589 GetPRInsightsSummary(ctx context.Context, arg GetPRInsightsSummaryParams) (GetPRInsightsSummaryRow, error)
590 // Returns daily PR counts grouped by state for the chart.
591 // Uses a CTE to deduplicate by PR URL so that multiple chats referencing
592 // the same pull request are only counted once (keeping the most recent chat).

Callers 5

prInsightsMethod · 0.65
TestGetPRInsightsFunction · 0.65
GetPRInsightsSummaryMethod · 0.65
GetPRInsightsSummaryMethod · 0.65
TestTemplateMethod · 0.65

Implementers 5

sqlQueriercoderd/database/db.go
queryMetricsStorecoderd/database/dbmetrics/querymetrics
queriercoderd/database/dbauthz/dbauthz.go
MockStorecoderd/database/dbmock/dbmock.go
MockStoreMockRecordercoderd/database/dbmock/dbmock.go

Calls

no outgoing calls

Tested by 2

TestGetPRInsightsFunction · 0.52
TestTemplateMethod · 0.52