StormByte-Database 2.0.0
C++26 database module of the StormByte suite
 
Loading...
Searching...
No Matches
telemetry.hxx
Go to the documentation of this file.
1/*
2 * SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-StormByte-Commercial
3 */
4#pragma once
5
7
8#include <string_view>
9#include <atomic>
10
12 class Postgres;
13 class PreparedSTMT;
14
20 public:
22 Telemetry() noexcept;
24 ~Telemetry() noexcept override;
26 std::uint64_t SerializationConflicts() const noexcept;
28 std::uint64_t Deadlocks() const noexcept;
30 std::uint64_t ConnectionErrors() const noexcept;
32 operator StormByte::String::String() const override;
33 private:
34 friend class Postgres;
35 friend class PreparedSTMT;
36 void RecordSqlState(std::string_view sql_state) noexcept;
37 void RecordEvent(BackendEvent event) noexcept override;
38 std::atomic<std::uint64_t> m_serialization_conflicts{0};
39 std::atomic<std::uint64_t> m_deadlocks{0};
40 std::atomic<std::uint64_t> m_connection_errors{0};
41 };
42}
PostgreSQL backend.
Definition postgres.hxx:76
PostgreSQL prepared statement (PQexecPrepared).
Definition prepared_stmt.hxx:73
PostgreSQL-specific counters layered on common database telemetry.
Definition telemetry.hxx:19
Telemetry() noexcept
Construct zeroed PostgreSQL counters.
Thread-safe cumulative telemetry for one database connection.
Definition telemetry.hxx:96
PostgreSQL backend of the Database module.
BackendEvent
Shared error and warning categories for backend-specific telemetry.
Definition telemetry.hxx:54
Root namespace of the StormByte C++ suite.
STL namespace.
#define STORMBYTE_DATABASE_PUBLIC
Definition visibility.h:54