Files
FTL/test/api
010011110 4f628abcf5 Key /api/history/database/clients by client address and bucket the slots
The clients object was keyed by the address from `client_by_id` and
carried only the name, while history[].data was keyed by the raw
`query_storage.client` column, which holds the `client_by_id` id. The two
halves of the response could not be joined, unlike the in-memory
`/api/history/clients` that shares the client_history schema and reports
{name, total} per address.

The slot query also grouped by `(timestamp/:interval)*:interval`, which
is a real division since the timestamps are stored with a fractional
part, so nothing was grouped: the data object received one entry per
query, repeating the same key with a count of 1.

Join `client_by_id` in both statements and group by the address (an
address can have several ids, one per name it was seen with), add the
per-client total, and truncate the timestamp before the integer division
so the slots form.

Signed-off-by: 010011110 <duckenheim@posteo.de>
2026-09-22 07:55:23 +02:00
..
…
…