|
ORE Studio 0.0.4
|
Persistence for compute grid telemetry time-series samples. More...
#include <compute_telemetry_repository.hpp>

Public Types | |
| using | context = ores::database::context |
Public Member Functions | |
| void | insert_grid_sample (context ctx, const domain::grid_sample &sample) |
| Insert one grid-level sample row. | |
| void | insert_node_sample (context ctx, const domain::node_sample &sample) |
| Insert one node-level sample row. | |
| std::optional< domain::grid_sample > | latest_grid_sample (context ctx) |
| Return the most recent grid sample for the context's tenant. | |
| std::vector< domain::node_sample > | latest_node_samples (context ctx) |
| Return the most recent sample per node for the context's tenant. | |
| domain::grid_sample | compute_grid_stats (context ctx) |
| Compute current grid statistics using SQL aggregations. | |
Persistence for compute grid telemetry time-series samples.
Writes to ores_compute_grid_samples_tbl and ores_compute_node_samples_tbl (TimescaleDB hypertables).
| std::optional< domain::grid_sample > latest_grid_sample | ( | context | ctx | ) |
Return the most recent grid sample for the context's tenant.
Returns nullopt if no samples exist yet.
| std::vector< domain::node_sample > latest_node_samples | ( | context | ctx | ) |
Return the most recent sample per node for the context's tenant.
Uses DISTINCT ON (host_id) to return exactly one row per host, the one with the most recent sampled_at, in a single database query.
| domain::grid_sample compute_grid_stats | ( | context | ctx | ) |
Compute current grid statistics using SQL aggregations.
Runs a single parameterized CTE query against the compute domain tables (hosts, results, workunits, batches) to return counts and breakdowns without loading full tables into memory. Sets sampled_at to now().