MySQL 8.4.2
Source Code Documentation
binlog::monitoring::Compression_stats Class Reference

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, mysql::binlog::event::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...
 
mysql::binlog::event::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_rowZERO_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...
 
mysql::binlog::event::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...
 

Detailed Description

This class represents the compression stats collected for a given combination of log type and compression type.

Member Typedef Documentation

◆ Compression_stats_trx_row

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:

  • transaction id : string
  • compressed bytes : uint64
  • uncompressed bytes : uint64
  • timestamp : uint64

Member Enumeration Documentation

◆ enum_trx_type

Enum stating whether FIRST or LAST transaction.

Enumerator
FIRST 
LAST 

Constructor & Destructor Documentation

◆ Compression_stats() [1/3]

binlog::monitoring::Compression_stats::Compression_stats ( )
delete

◆ Compression_stats() [2/3]

binlog::monitoring::Compression_stats::Compression_stats ( log_type  log,
mysql::binlog::event::compression::type  t 
)

Initializes the compression stats for the given log type and compression type.

It initializes the counters and transaction stats to 0.

◆ Compression_stats() [3/3]

binlog::monitoring::Compression_stats::Compression_stats ( Compression_stats rhs)

Copies the contents of the object referenced as a parameter.

Parameters
rhsThe object to copy.

◆ ~Compression_stats()

binlog::monitoring::Compression_stats::~Compression_stats ( )
virtual

The destructor of this row.

Member Function Documentation

◆ add()

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.

Parameters
gtidthe transaction identifier as a string.
transaction_timestampThe transaction timestamp as seconds since the epoch.
comp_bytesThe compressed bytes counter for the given transaction.
uncomp_bytesThe uncompressed bytes counter for the given transaction.

◆ destroy()

void binlog::monitoring::Compression_stats::destroy ( )
protected

This member function shall destroy the object data structures.

Used by the object destroyer.

◆ destroy_transaction_stats()

void binlog::monitoring::Compression_stats::destroy_transaction_stats ( enum_trx_type  type)
protected

This member function shall claim memory used for tracking transaction stats.

Parameters
typeWhether the FIRST or the LAST transaction.

◆ get_counter_compressed_bytes()

uint64_t binlog::monitoring::Compression_stats::get_counter_compressed_bytes ( ) const

Gets the sum of compressed bytes accounted for by this object instance.

Returns
sum of compressed bytes for this object instance.

◆ get_counter_transactions()

uint64_t binlog::monitoring::Compression_stats::get_counter_transactions ( ) const

Gets the number of transactions counted.

Returns
number of transactions counted.

◆ get_counter_uncompressed_bytes()

uint64_t binlog::monitoring::Compression_stats::get_counter_uncompressed_bytes ( ) const

Gets the sum of uncompressed bytes accounted for by this object instance.

Returns
sum of uncompressed bytes for this object instance.

◆ get_first_transaction_stats()

Compression_stats::Compression_stats_trx_row binlog::monitoring::Compression_stats::get_first_transaction_stats ( )

Gets the stats of the first transaction.

Returns
the stats for the first transaction.

◆ get_last_transaction_stats()

Compression_stats::Compression_stats_trx_row binlog::monitoring::Compression_stats::get_last_transaction_stats ( )

Gets the stats for the last transaction.

Returns
the stats for the last transaction.

◆ get_log_type()

log_type binlog::monitoring::Compression_stats::get_log_type ( ) const

Gets the log type that this object instance is tracking.

◆ get_transaction_stats()

Compression_stats::Compression_stats_trx_row binlog::monitoring::Compression_stats::get_transaction_stats ( enum_trx_type  type)
protected

This member function shall return the compression stats for the given transaction.

Parameters
typethe transaction to get the status for (either FIRST or LAST).
Returns
the compression stats for the given transaction.

◆ get_type()

mysql::binlog::event::compression::type binlog::monitoring::Compression_stats::get_type ( ) const

Gets the compression type that this object instance is tracking.

◆ reset()

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.

◆ ZERO_TRX_ROW()

const Compression_stats::Compression_stats_trx_row & binlog::monitoring::Compression_stats::ZERO_TRX_ROW ( )
static

A constant and static instance of the transaction compression stats.

Compression_stats ------------------------------------------------—.

Member Data Documentation

◆ m_counter_compressed_bytes

std::atomic<uint64_t> binlog::monitoring::Compression_stats::m_counter_compressed_bytes {0}
protected

Sum of all compressed bytes for all transactions observed through this object instance.

◆ m_counter_transactions

std::atomic<uint64_t> binlog::monitoring::Compression_stats::m_counter_transactions {0}
protected

Counter that tracks how many transactions have been observed.

◆ m_counter_uncompressed_bytes

std::atomic<uint64_t> binlog::monitoring::Compression_stats::m_counter_uncompressed_bytes {0}
protected

Sum of all uncompressed bytes for all transactions observed through this object instance.

◆ m_first_transaction_stats

std::atomic<Compression_stats_trx_row *> binlog::monitoring::Compression_stats::m_first_transaction_stats {nullptr}
protected

This tuple contains information about the first transaction.

◆ m_last_transaction_stats

std::atomic<Compression_stats_trx_row *> binlog::monitoring::Compression_stats::m_last_transaction_stats {nullptr}
protected

This tuple contains information about the last transaction.

◆ m_log_type

log_type binlog::monitoring::Compression_stats::m_log_type {BINARY}
protected

The log type.

◆ m_type

mysql::binlog::event::compression::type binlog::monitoring::Compression_stats::m_type
protected
Initial value:

The compression type.


The documentation for this class was generated from the following files: