mirror of
https://github.com/coder/coder.git
synced 2025-07-06 15:41:45 +00:00
As requested for [this issue](https://github.com/coder/internal/issues/245) we need to have a new resource `resources_monitoring` in the agent. It needs to be parsed from the provisioner and inserted into a new db table.
39 lines
653 B
SQL
39 lines
653 B
SQL
-- name: FetchMemoryResourceMonitorsByAgentID :one
|
|
SELECT
|
|
*
|
|
FROM
|
|
workspace_agent_memory_resource_monitors
|
|
WHERE
|
|
agent_id = $1;
|
|
|
|
-- name: FetchVolumesResourceMonitorsByAgentID :many
|
|
SELECT
|
|
*
|
|
FROM
|
|
workspace_agent_volume_resource_monitors
|
|
WHERE
|
|
agent_id = $1;
|
|
|
|
-- name: InsertMemoryResourceMonitor :one
|
|
INSERT INTO
|
|
workspace_agent_memory_resource_monitors (
|
|
agent_id,
|
|
enabled,
|
|
threshold,
|
|
created_at
|
|
)
|
|
VALUES
|
|
($1, $2, $3, $4) RETURNING *;
|
|
|
|
-- name: InsertVolumeResourceMonitor :one
|
|
INSERT INTO
|
|
workspace_agent_volume_resource_monitors (
|
|
agent_id,
|
|
path,
|
|
enabled,
|
|
threshold,
|
|
created_at
|
|
)
|
|
VALUES
|
|
($1, $2, $3, $4, $5) RETURNING *;
|