mirror of
https://github.com/lorsanstand/HomeOps-Hub.git
synced 2026-06-19 20:05:17 +03:00
refactor: create heartbeats func in HubStore
This commit is contained in:
@@ -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;
|
||||
Reference in New Issue
Block a user