ORE Studio 0.0.4
Loading...
Searching...
No Matches
node_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_NODE_SAMPLE_HPP
21#define ORES_COMPUTE_DOMAIN_NODE_SAMPLE_HPP
22
23#include <chrono>
24#include <cstdint>
25#include <boost/uuid/uuid.hpp>
26#include "ores.utility/uuid/tenant_id.hpp"
27
28namespace ores::compute::domain {
29
36struct node_sample final {
38 std::chrono::system_clock::time_point sampled_at;
39
42
44 boost::uuids::uuid host_id;
45
46 // -------------------------------------------------------------------------
47 // Cumulative counters since the wrapper process started
48 // -------------------------------------------------------------------------
49
50 int tasks_completed{0};
51 int tasks_failed{0};
52
53 // -------------------------------------------------------------------------
54 // Delta counters since the previous sample
55 // -------------------------------------------------------------------------
56
57 int tasks_since_last{0};
58
60 std::int64_t avg_task_duration_ms{0};
61
63 std::int64_t max_task_duration_ms{0};
64
66 std::int64_t input_bytes_fetched{0};
67
69 std::int64_t output_bytes_uploaded{0};
70
73};
74
75}
76
77#endif
A single point-in-time sample of per-node execution metrics.
Definition node_sample.hpp:36
std::chrono::system_clock::time_point sampled_at
When this sample was taken (hypertable partition key).
Definition node_sample.hpp:38
std::int64_t max_task_duration_ms
Peak task duration for tasks_since_last (milliseconds).
Definition node_sample.hpp:63
std::int64_t avg_task_duration_ms
Average task duration for tasks_since_last (milliseconds).
Definition node_sample.hpp:60
int seconds_since_hb
Seconds since the last heartbeat was received for this host.
Definition node_sample.hpp:72
boost::uuids::uuid host_id
FK to ores_compute_hosts_tbl.
Definition node_sample.hpp:44
std::int64_t output_bytes_uploaded
Total output bytes uploaded for tasks_since_last.
Definition node_sample.hpp:69
utility::uuid::tenant_id tenant_id
Tenant this node belongs to.
Definition node_sample.hpp:41
std::int64_t input_bytes_fetched
Total input bytes fetched for tasks_since_last.
Definition node_sample.hpp:66
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