mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: add connection statistics for workspace agents (#6469)
* fix: don't make session counts cumulative This made for some weird tracking... we want the point-in-time number of counts! * Add databasefake query for getting agent stats * Add deployment stats endpoint * The query... works?!? * Fix aggregation query * Select from multiple tables instead * Fix continuous stats * Increase period of stat refreshes * Add workspace counts to deployment stats * fmt * Add a slight bit of responsiveness * Fix template version editor overflow * Add refresh button * Fix font family on button * Fix latest stat being reported * Revert agent conn stats * Fix linting error * Fix tests * Fix gen * Fix migrations * Block on sending stat updates * Add test fixtures * Fix response structure * make gen
This commit is contained in:
@@ -0,0 +1 @@
|
||||
ALTER TABLE workspace_agent_stats ALTER COLUMN connection_median_latency_ms TYPE bigint;
|
||||
@@ -0,0 +1 @@
|
||||
ALTER TABLE workspace_agent_stats ALTER COLUMN connection_median_latency_ms TYPE FLOAT;
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
INSERT INTO workspace_agent_stats (
|
||||
id,
|
||||
created_at,
|
||||
user_id,
|
||||
agent_id,
|
||||
workspace_id,
|
||||
template_id,
|
||||
connection_median_latency_ms
|
||||
) VALUES (
|
||||
gen_random_uuid(),
|
||||
NOW(),
|
||||
gen_random_uuid(),
|
||||
gen_random_uuid(),
|
||||
gen_random_uuid(),
|
||||
gen_random_uuid(),
|
||||
1::bigint
|
||||
);
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
INSERT INTO workspace_agent_stats (
|
||||
id,
|
||||
created_at,
|
||||
user_id,
|
||||
agent_id,
|
||||
workspace_id,
|
||||
template_id,
|
||||
connection_median_latency_ms
|
||||
) VALUES (
|
||||
gen_random_uuid(),
|
||||
NOW(),
|
||||
gen_random_uuid(),
|
||||
gen_random_uuid(),
|
||||
gen_random_uuid(),
|
||||
gen_random_uuid(),
|
||||
0.5::float
|
||||
);
|
||||
Reference in New Issue
Block a user