MySQL 8.0.39
Source Code Documentation
|
This class represents the compression stats collected for a given combination of log type and compression type. More...
#include <context.h>
Public Types | |
using | Compression_stats_trx_row = std::tuple< std::string, uint64_t, uint64_t, uint64_t > |
This tuple contains information about a transaction: More... | |
Public Member Functions | |
Compression_stats ()=delete | |
Compression_stats (log_type log, binary_log::transaction::compression::type) | |
Initializes the compression stats for the given log type and compression type. More... | |
Compression_stats (Compression_stats &rhs) | |
Copies the contents of the object referenced as a parameter. More... | |
virtual | ~Compression_stats () |
The destructor of this row. More... | |
void | add (std::string gtid, uint64_t transaction_timestamp, uint64_t comp_bytes, uint64_t uncomp_bytes) |
Updates the existing stats with the ones passed as argument. More... | |
void | reset () |
This member function shall reset the counters to zero and clear the transaction stats for both FIRST and LAST transactions. More... | |
log_type | get_log_type () const |
Gets the log type that this object instance is tracking. More... | |
binary_log::transaction::compression::type | get_type () const |
Gets the compression type that this object instance is tracking. More... | |
uint64_t | get_counter_transactions () const |
Gets the number of transactions counted. More... | |
uint64_t | get_counter_compressed_bytes () const |
Gets the sum of compressed bytes accounted for by this object instance. More... | |
uint64_t | get_counter_uncompressed_bytes () const |
Gets the sum of uncompressed bytes accounted for by this object instance. More... | |
Compression_stats_trx_row | get_last_transaction_stats () |
Gets the stats for the last transaction. More... | |
Compression_stats_trx_row | get_first_transaction_stats () |
Gets the stats of the first transaction. More... | |
Static Public Member Functions | |
static const Compression_stats_trx_row & | ZERO_TRX_ROW () |
A constant and static instance of the transaction compression stats. More... | |
Protected Types | |
enum | enum_trx_type { FIRST = 0 , LAST } |
Enum stating whether FIRST or LAST transaction. More... | |
Protected Member Functions | |
void | destroy_transaction_stats (enum_trx_type type) |
This member function shall claim memory used for tracking transaction stats. More... | |
void | destroy () |
This member function shall destroy the object data structures. More... | |
Compression_stats_trx_row | get_transaction_stats (enum_trx_type type) |
This member function shall return the compression stats for the given transaction. More... | |
Protected Attributes | |
log_type | m_log_type {BINARY} |
The log type. More... | |
binary_log::transaction::compression::type | m_type |
The compression type. More... | |
std::atomic< uint64_t > | m_counter_transactions {0} |
Counter that tracks how many transactions have been observed. More... | |
std::atomic< uint64_t > | m_counter_compressed_bytes {0} |
Sum of all compressed bytes for all transactions observed through this object instance. More... | |
std::atomic< uint64_t > | m_counter_uncompressed_bytes {0} |
Sum of all uncompressed bytes for all transactions observed through this object instance. More... | |
std::atomic< Compression_stats_trx_row * > | m_first_transaction_stats {nullptr} |
This tuple contains information about the first transaction. More... | |
std::atomic< Compression_stats_trx_row * > | m_last_transaction_stats {nullptr} |
This tuple contains information about the last transaction. More... | |
This class represents the compression stats collected for a given combination of log type and compression type.
using binlog::monitoring::Compression_stats::Compression_stats_trx_row = std::tuple<std::string, uint64_t, uint64_t, uint64_t> |
This tuple contains information about a transaction:
|
protected |
|
delete |
binlog::monitoring::Compression_stats::Compression_stats | ( | log_type | log, |
binary_log::transaction::compression::type | t | ||
) |
Initializes the compression stats for the given log type and compression type.
It initializes the counters and transaction stats to 0.
binlog::monitoring::Compression_stats::Compression_stats | ( | Compression_stats & | rhs | ) |
Copies the contents of the object referenced as a parameter.
rhs | The object to copy. |
|
virtual |
The destructor of this row.
void binlog::monitoring::Compression_stats::add | ( | std::string | gtid, |
uint64_t | transaction_timestamp, | ||
uint64_t | comp_bytes, | ||
uint64_t | uncomp_bytes | ||
) |
Updates the existing stats with the ones passed as argument.
gtid | the transaction identifier as a string. |
transaction_timestamp | The transaction timestamp as seconds since the epoch. |
comp_bytes | The compressed bytes counter for the given transaction. |
uncomp_bytes | The uncompressed bytes counter for the given transaction. |
|
protected |
This member function shall destroy the object data structures.
Used by the object destroyer.
|
protected |
This member function shall claim memory used for tracking transaction stats.
type | Whether the FIRST or the LAST transaction. |
uint64_t binlog::monitoring::Compression_stats::get_counter_compressed_bytes | ( | ) | const |
Gets the sum of compressed bytes accounted for by this object instance.
uint64_t binlog::monitoring::Compression_stats::get_counter_transactions | ( | ) | const |
Gets the number of transactions counted.
uint64_t binlog::monitoring::Compression_stats::get_counter_uncompressed_bytes | ( | ) | const |
Gets the sum of uncompressed bytes accounted for by this object instance.
Compression_stats::Compression_stats_trx_row binlog::monitoring::Compression_stats::get_first_transaction_stats | ( | ) |
Gets the stats of the first transaction.
Compression_stats::Compression_stats_trx_row binlog::monitoring::Compression_stats::get_last_transaction_stats | ( | ) |
Gets the stats for the last transaction.
log_type binlog::monitoring::Compression_stats::get_log_type | ( | ) | const |
Gets the log type that this object instance is tracking.
|
protected |
This member function shall return the compression stats for the given transaction.
type | the transaction to get the status for (either FIRST or LAST). |
binary_log::transaction::compression::type binlog::monitoring::Compression_stats::get_type | ( | ) | const |
Gets the compression type that this object instance is tracking.
void binlog::monitoring::Compression_stats::reset | ( | ) |
This member function shall reset the counters to zero and clear the transaction stats for both FIRST and LAST transactions.
|
static |
A constant and static instance of the transaction compression stats.
Compression_stats ------------------------------------------------—.
|
protected |
Sum of all compressed bytes for all transactions observed through this object instance.
|
protected |
Counter that tracks how many transactions have been observed.
|
protected |
Sum of all uncompressed bytes for all transactions observed through this object instance.
|
protected |
This tuple contains information about the first transaction.
|
protected |
This tuple contains information about the last transaction.
|
protected |
The compression type.