ORE Studio 0.0.4
Loading...
Searching...
No Matches
grid_sample.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 *
3 * Copyright (C) 2026 Marco Craveiro <marco.craveiro@gmail.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License as published by the Free Software
7 * Foundation; either version 3 of the License, or (at your option) any later
8 * version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 * details.
14 *
15 * You should have received a copy of the GNU General Public License along with
16 * this program; if not, write to the Free Software Foundation, Inc., 51
17 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 *
19 */
20#ifndef ORES_COMPUTE_DOMAIN_GRID_SAMPLE_HPP
21#define ORES_COMPUTE_DOMAIN_GRID_SAMPLE_HPP
22
23#include <chrono>
24#include "ores.utility/uuid/tenant_id.hpp"
25
26namespace ores::compute::domain {
27
35struct grid_sample final {
37 std::chrono::system_clock::time_point sampled_at;
38
41
42 // -------------------------------------------------------------------------
43 // Host counts
44 // -------------------------------------------------------------------------
45
48
53
57 int idle_hosts{0};
58
59 // -------------------------------------------------------------------------
60 // Result state breakdown (server_state codes)
61 // -------------------------------------------------------------------------
62
65
68
71
74
75 // -------------------------------------------------------------------------
76 // Workunit / batch counts
77 // -------------------------------------------------------------------------
78
81
84
89
90 // -------------------------------------------------------------------------
91 // Outcome breakdown for results completed in the last 24 hours
92 // (outcome codes: 1=Success 3=ClientError 4=NoReply)
93 // -------------------------------------------------------------------------
94
95 int outcomes_success{0};
96 int outcomes_client_error{0};
97 int outcomes_no_reply{0};
98};
99
100}
101
102#endif
A single point-in-time snapshot of server-side compute grid metrics.
Definition grid_sample.hpp:35
int active_batches
Batches that have at least one InProgress result.
Definition grid_sample.hpp:88
std::chrono::system_clock::time_point sampled_at
When this sample was taken (hypertable partition key).
Definition grid_sample.hpp:37
int results_unsent
Results in state 2 (Unsent).
Definition grid_sample.hpp:67
int results_inactive
Results in state 1 (Inactive).
Definition grid_sample.hpp:64
int results_in_progress
Results in state 4 (InProgress).
Definition grid_sample.hpp:70
int results_done
Results in state 5 (Done).
Definition grid_sample.hpp:73
int online_hosts
Hosts whose last heartbeat is within the 5-minute reaper window.
Definition grid_sample.hpp:52
int total_workunits
Total workunits.
Definition grid_sample.hpp:80
int total_hosts
Total registered hosts (all versions).
Definition grid_sample.hpp:47
int total_batches
Total batches.
Definition grid_sample.hpp:83
utility::uuid::tenant_id tenant_id
Tenant this sample belongs to.
Definition grid_sample.hpp:40
int idle_hosts
Online hosts that have no InProgress result assigned to them.
Definition grid_sample.hpp:57
A strongly-typed wrapper around a UUID representing a tenant identifier.
Definition tenant_id.hpp:66
static tenant_id system()
Creates a tenant_id representing the system tenant.
Definition tenant_id.cpp:41