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 <atomic>
9
11 class MariaDB;
12 class PreparedSTMT;
13
19 public:
21 Telemetry() noexcept;
23 ~Telemetry() noexcept override;
25 std::uint64_t Deadlocks() const noexcept;
27 std::uint64_t LockTimeouts() const noexcept;
29 std::uint64_t Warnings() const noexcept;
31 operator StormByte::String::String() const override;
32 private:
33 friend class MariaDB;
34 friend class PreparedSTMT;
35 void RecordMariaDBError(unsigned int error_code) noexcept;
36 void RecordMariaDBWarnings(std::uint64_t count) noexcept;
37 void RecordEvent(BackendEvent event) noexcept override;
38 std::atomic<std::uint64_t> m_deadlocks{0};
39 std::atomic<std::uint64_t> m_lock_timeouts{0};
40 std::atomic<std::uint64_t> m_warnings{0};
41 };
42}
MariaDB / MySQL backend.
Definition mariadb.hxx:76
MariaDB prepared statement.
Definition prepared_stmt.hxx:76
MariaDB-specific counters layered on common database telemetry.
Definition telemetry.hxx:18
Telemetry() noexcept
Construct zeroed MariaDB counters.
Thread-safe cumulative telemetry for one database connection.
Definition telemetry.hxx:96
MariaDB 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