mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
fix(metrics): align hourly query lower bound to start of UTC hour
hourlySince used now-23h (partial first bucket, undercounting the oldest hourly point). Align to start of current UTC hour like loadHourlyUsers and the chart bucket loop so all 24 buckets are full and keys line up.
This commit is contained in:
parent
f77f775917
commit
9dfab510dc
@ -1425,7 +1425,11 @@ async function loadAnalyticsOverview(
|
||||
ORDER BY hour ASC
|
||||
`,
|
||||
query_params: {
|
||||
hourlySince: formatClickhouseDateTimeParam(new Date(now.getTime() - 23 * 60 * 60 * 1000)),
|
||||
hourlySince: formatClickhouseDateTimeParam((() => {
|
||||
const latestHour = new Date(now);
|
||||
latestHour.setUTCMinutes(0, 0, 0);
|
||||
return new Date(latestHour.getTime() - 23 * 60 * 60 * 1000);
|
||||
})()),
|
||||
since: formatClickhouseDateTimeParam(since),
|
||||
untilExclusive: formatClickhouseDateTimeParam(untilExclusive),
|
||||
projectId: tenancy.project.id,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user