DoH probe-outcomes summary with now-vs-prior-run delta (D-0059) #140
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/doh-probe-outcomes-summary"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What does this PR do?
Adds a DoH probe-outcomes summary so an operator can see, at a glance, how many DoH candidate addresses sit in each probe outcome, with a delta comparing the most recent probe cycle against the previous one (D-0059).
A "Probe outcomes" panel on
/configuration#doh-blocklistrenders a Now / Prior run / Delta table across the five outcomes (Confirmed, RespondedNonCompliant, Refused, Timeout, Unprobed). The Refused row is split into indented sub-rows by the HTTP status the resolver returned (or "no HTTP response" for a transport-level refusal). The same data is exposed read-only atGET /api/v1/doh/probes/summary.The per-address probe results already persisted in
doh_probe_results, but nothing aggregated them.IDohProbeResultStore.CountByStatusAsyncreturns per-(status, HTTP-status) tallies (a SQLGROUP BYon Postgres, not a full-row load).DohProbeWorkerfolds those into aDohProbeOutcomeSummaryat each cycle end and saves it through the newIDohProbeSummaryStore. Because the probe worker runs in the PipelineHost while the Admin UI/API run in the AdminApi, the summary is persisted so the two share it through Postgres, following the D-0055 single-row reconciliation-proposal pattern: a single-rowdoh_probe_summarytable (fixed id 1, check constraintid = 1,detail_jsonsnapshot), in-memory and Postgres stores, and EF migrationAddDohProbeSummarythat auto-applies on deploy.Delta semantics: "prior run" is the previous completed probe cycle (an on-demand probe-now cycle counts as a run). Both summaries are captured at cycle end so they are directly comparable snapshots; the delta is Now minus Prior per category and is stable across page reloads. The stored snapshot keeps exactly two summaries, Current and Prior, rolled on each save, so there is no history growth. Until a second cycle completes, Prior is null and the delta column shows a placeholder.
This is read-only status data, not a behaviour-controlling value, so the standing "expose in both the Admin UI and the API" rule is satisfied by the panel plus the endpoint; no new configuration value is introduced.
Fixes #
How was this tested?
dotnet build- 0 errors, 0 warningsdotnet test- all tests pass (Application 594, AdminApi 230)New tests:
FromCountsaggregation and refused-split ordering, in-memory summary-store roll (Prior = old Current), and the endpoint's null-snapshot and populated current/prior/deltas shapes.Assumptions
Totalcounts probed addresses only; feed CIDR ranges are never probed and carry no probe record, so they are excluded from the counts.Checklist