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 SQLite3;
12 class PreparedSTMT;
18 public:
20 Telemetry() noexcept;
22 ~Telemetry() noexcept override;
24 std::uint64_t BusyErrors() const noexcept;
26 std::uint64_t ConstraintErrors() const noexcept;
28 std::uint64_t IoErrors() const noexcept;
30 std::uint64_t CorruptionErrors() const noexcept;
32 operator StormByte::String::String() const override;
33 private:
34 friend class SQLite3;
35 friend class PreparedSTMT;
36 void RecordSQLiteResult(int result_code) noexcept;
37 void RecordEvent(BackendEvent event) noexcept override;
38 std::atomic<std::uint64_t> m_corruption_errors{0};
39 std::atomic<std::uint64_t> m_busy_errors{0};
40 std::atomic<std::uint64_t> m_constraint_errors{0};
41 std::atomic<std::uint64_t> m_io_errors{0};
42 };
43}
SQLite prepared statement.
Definition prepared_stmt.hxx:69
SQLite3 backend.
Definition sqlite3.hxx:76
SQLite-specific counters layered on common database telemetry.
Definition telemetry.hxx:17
Telemetry() noexcept
Construct zeroed SQLite counters.
Thread-safe cumulative telemetry for one database connection.
Definition telemetry.hxx:96
SQLite 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