refactor: create heartbeats func in HubStore

This commit is contained in:
2026-05-09 22:31:42 +03:00
parent f2d0924bca
commit 6277523b23
9 changed files with 158 additions and 11 deletions
@@ -0,0 +1,7 @@
-- name: InsertHeartbeat :exec
INSERT INTO heartbeats (agent_id, cpu_usage, memory_usage, disk_usage, heartbeat_timestamp)
VALUES (:agent_id, :cpu_usage, :memory_usage, :disk_usage, :heartbeat_timestamp);
-- name: SelectHeartbeatsAfter :many
SELECT * FROM heartbeats
WHERE agent_id = :agent_id AND heartbeat_timestamp > :timestamp;