ORE Studio 0.0.4
Loading...
Searching...
No Matches
telemetry_stats.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 *
3 * Copyright (C) 2025 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_TELEMETRY_DOMAIN_TELEMETRY_STATS_HPP
21#define ORES_TELEMETRY_DOMAIN_TELEMETRY_STATS_HPP
22
23#include <chrono>
24#include <string>
25#include <cstdint>
26#include "ores.telemetry/domain/telemetry_source.hpp"
27
29
36struct telemetry_stats final {
43 std::chrono::system_clock::time_point period_start;
44
49
55 std::string source_name;
56
63 std::string component;
64
68 std::string level;
69
73 std::uint64_t log_count = 0;
74
78 std::uint32_t unique_sessions = 0;
79
83 std::uint32_t unique_accounts = 0;
84};
85
91struct telemetry_summary final {
95 std::chrono::system_clock::time_point start_time;
96
100 std::chrono::system_clock::time_point end_time;
101
105 std::uint64_t total_logs = 0;
106
110 std::uint64_t error_count = 0;
111
115 std::uint64_t warn_count = 0;
116
120 std::uint64_t info_count = 0;
121
125 std::uint64_t debug_count = 0;
126
130 std::uint64_t trace_count = 0;
131
135 std::uint32_t unique_sources = 0;
136
140 std::uint32_t unique_sessions = 0;
141
145 std::uint32_t unique_accounts = 0;
146};
147
148}
149
150#endif
Domain types for telemetry and observability.
Definition attribute_value.hpp:29
telemetry_source
Source type for telemetry log entries.
Definition telemetry_source.hpp:33
@ client
Log entry from a client application.
Aggregated telemetry statistics for a time period.
Definition telemetry_stats.hpp:36
std::uint64_t log_count
Total log count for this combination.
Definition telemetry_stats.hpp:73
std::string level
Log level.
Definition telemetry_stats.hpp:68
telemetry_source source
Source type (client or server).
Definition telemetry_stats.hpp:48
std::chrono::system_clock::time_point period_start
Start of the aggregation period.
Definition telemetry_stats.hpp:43
std::uint32_t unique_sessions
Number of unique sessions that generated logs.
Definition telemetry_stats.hpp:78
std::string component
Component name.
Definition telemetry_stats.hpp:63
std::string source_name
Source application name.
Definition telemetry_stats.hpp:55
std::uint32_t unique_accounts
Number of unique accounts that generated logs.
Definition telemetry_stats.hpp:83
Summary statistics for a telemetry overview.
Definition telemetry_stats.hpp:91
std::uint64_t total_logs
Total log count.
Definition telemetry_stats.hpp:105
std::chrono::system_clock::time_point end_time
Time range end.
Definition telemetry_stats.hpp:100
std::uint64_t error_count
Error log count.
Definition telemetry_stats.hpp:110
std::uint32_t unique_sessions
Number of unique sessions.
Definition telemetry_stats.hpp:140
std::uint64_t info_count
Info log count.
Definition telemetry_stats.hpp:120
std::uint64_t trace_count
Trace log count.
Definition telemetry_stats.hpp:130
std::uint32_t unique_sources
Number of unique source applications.
Definition telemetry_stats.hpp:135
std::chrono::system_clock::time_point start_time
Time range start.
Definition telemetry_stats.hpp:95
std::uint64_t debug_count
Debug log count.
Definition telemetry_stats.hpp:125
std::uint64_t warn_count
Warning log count.
Definition telemetry_stats.hpp:115
std::uint32_t unique_accounts
Number of unique accounts.
Definition telemetry_stats.hpp:145