mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
Daily Active User Metrics (#3735)
* agent: add StatsReporter * Stabilize protoc
This commit is contained in:
1
coderd/database/migrations/000042_agent_stats.down.sql
Normal file
1
coderd/database/migrations/000042_agent_stats.down.sql
Normal file
@ -0,0 +1 @@
|
||||
DROP TABLE agent_stats;
|
16
coderd/database/migrations/000042_agent_stats.up.sql
Normal file
16
coderd/database/migrations/000042_agent_stats.up.sql
Normal file
@ -0,0 +1,16 @@
|
||||
CREATE TABLE agent_stats (
|
||||
id uuid NOT NULL,
|
||||
PRIMARY KEY (id),
|
||||
created_at timestamptz NOT NULL,
|
||||
user_id uuid NOT NULL,
|
||||
agent_id uuid NOT NULL,
|
||||
workspace_id uuid NOT NULL,
|
||||
template_id uuid NOT NULL,
|
||||
payload jsonb NOT NULL
|
||||
);
|
||||
|
||||
-- We use created_at for DAU analysis and pruning.
|
||||
CREATE INDEX idx_agent_stats_created_at ON agent_stats USING btree (created_at);
|
||||
|
||||
-- We perform user grouping to analyze DAUs.
|
||||
CREATE INDEX idx_agent_stats_user_id ON agent_stats USING btree (user_id);
|
Reference in New Issue
Block a user