feat: upsert stats counters, daily buckets and ETS tops for admin metrics. Refs EventHub/EventHubBack#42 #43 #44 #45 #46
CI / test (push) Failing after 25m40s
CI / deploy-ift (push) Has been skipped
CI / e2e-ift (push) Has been skipped
CI / deploy-stage (push) Has been skipped
CI / e2e-stage (push) Has been skipped

This commit is contained in:
2026-07-17 23:10:00 +03:00
parent f2445db66c
commit dd754e28cc
20 changed files with 1885 additions and 408 deletions
+15 -6
View File
@@ -282,12 +282,21 @@
created_at :: calendar:datetime()
}).
-record(stats, {
id :: binary(),
metric :: atom(),
entity_id :: binary(),
value :: integer() | {integer(), integer()},
timestamp :: calendar:datetime()
%% Upsert-счётчики админ-статистики (абсолютные значения).
%% key: atom() | {atom(), atom()} | {atom(), atom(), atom()}
%% users_total-подобные totals не храним (table_info),
%% размерности: {user_by_status, pending}, {event_by_type, single}, ...
-record(stats_counter, {
key :: term(),
value :: integer(),
updated_at :: calendar:datetime()
}).
%% Дневные бакеты: key = {Metric :: atom(), Date :: calendar:date()}.
-record(stats_daily, {
key :: {atom(), calendar:date()},
value :: integer(),
updated_at :: calendar:datetime()
}).
-record(node_metric, {