The statistics API returns a summary, the queries-over-time series, top-N lists, the answer mix and upstream latency for a time range, for all nodes or one node #117
Labels
No labels
agent
api-regen
agent
architect
agent
coder
agent
console-coder
agent
docs-writer
agent
mechanic
agent
protocol-coder
agent
storage-coder
area/api
area/ci
area/console
area/dhcp
area/dns
area/docs
area/packaging
area/process
area/storage
area/windows
kind
bug
kind
chore
kind
docs
kind
epic
kind
feature
kind
performance
kind
security
kind
test
priority
high
priority
low
priority
medium
resolution
duplicate
resolution
not-a-bug
resolution
wontfix
status
blocked
status
in-progress
status
needs-decision
status
needs-design
status
ready
theme
ad-samba-dns
theme
alternatives-benchmark
theme
console-toolchain
theme
later
theme
parity-devices
theme
parity-query
theme
post-release-fixes
theme
tracker-setup
theme
valkey
theme
windows-installer
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
Depends on
Reference
lantea-one/ninlil#117
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Why
The console's four DNS chart sets need these reads, and the node filter needs the list of nodes.
What changes
Ninlil.Web/Controllers/StatisticsController.cs,[Route("api/statistics")]. Every action below takes an optionalnodeId; without it the answer covers all nodes (#111 rules: counters summed, gauges by maximum).GET nodes?fromUtc&toUtc: the nodes with statistics in the range, each{ nodeId, name, isThisNode }. The name comes from the peer registry (ClusterNodeEntity.NamewhereRemoteNodeIdmatches,src/dotnet/src/Ninlil.Dns.Data.Abstractions/Entity/ClusterNodeEntity.cs:25,34), "this node" forClusterOptions.NodeId, and the id otherwise.GET summary?fromUtc&toUtc: total, blocked, cached, NXDOMAIN, SERVFAIL, average latency.GET timeseries?fromUtc&toUtc&bucket=Minute|Hour: per buckettotal,blocked,cached.GET top?kind=Domain|BlockedDomain|Client&fromUtc&toUtc&take, with take capped at 100.GET mix?fromUtc&toUtc:queryTypes[],responseCodes[],answerSources[], each{ key, count }, from hour rows.GET upstreams?fromUtc&toUtc&bucket=Minute|Hour: per upstream the average latency and count over the range, and a series of per-bucket averages (sum divided by count).[ReadFromReplica]and requirequerylog:read. Technical call: top domains and clients reveal the same data as the query log, so they use the same permission, and no new permission is needed that existing roles lack.mixand hour buckets align the range to whole hours. An unknownnodeIdreturns empty results, not 404 (a node may simply have no rows yet).Acceptance
src/dotnet/tests/Ninlil.Web.Tests: fails first; after some answered queries plus a forced flush,GET summaryreturnstotalQueries >= n, andGET summary?nodeId=<this node>returns the same total. Do not assert an exact count, because the host is shared.GET nodeslists this node withisThisNode: true.GET mixafter an MX query returns anMXentry with count ≥ 1;GET upstreamsreturns one entry per upstream with a series.querylog:read.Source
audit-feature-parity.md§2A #1.