25#ifndef BINLOG_MONITORING_CONTEXT_H
26#define BINLOG_MONITORING_CONTEXT_H
54 std::tuple<std::string, uint64_t, uint64_t, uint64_t>;
161 void add(std::string gtid, uint64_t transaction_timestamp,
162 uint64_t comp_bytes, uint64_t uncomp_bytes);
217 std::map<std::pair<log_type, mysql::binlog::event::compression::type>,
247 uint64_t transaction_timestamp, uint64_t comp_bytes,
Represents a bidirectional map between TSID and SIDNO.
Definition: rpl_gtid.h:750
This class represents the compression stats collected for a given combination of log type and compres...
Definition: context.h:44
void reset()
This member function shall reset the counters to zero and clear the transaction stats for both FIRST ...
Definition: context.cc:185
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.
Definition: context.cc:122
std::atomic< uint64_t > m_counter_compressed_bytes
Sum of all compressed bytes for all transactions observed through this object instance.
Definition: context.h:87
std::atomic< uint64_t > m_counter_transactions
Counter that tracks how many transactions have been observed.
Definition: context.h:81
std::atomic< Compression_stats_trx_row * > m_last_transaction_stats
This tuple contains information about the last transaction.
Definition: context.h:103
std::atomic< Compression_stats_trx_row * > m_first_transaction_stats
This tuple contains information about the first transaction.
Definition: context.h:98
uint64_t get_counter_compressed_bytes() const
Gets the sum of compressed bytes accounted for by this object instance.
Definition: context.cc:77
void destroy()
This member function shall destroy the object data structures.
Definition: context.cc:227
std::atomic< uint64_t > m_counter_uncompressed_bytes
Sum of all uncompressed bytes for all transactions observed through this object instance.
Definition: context.h:93
Compression_stats()=delete
std::tuple< std::string, uint64_t, uint64_t, uint64_t > Compression_stats_trx_row
This tuple contains information about a transaction:
Definition: context.h:54
void destroy_transaction_stats(enum_trx_type type)
This member function shall claim memory used for tracking transaction stats.
Definition: context.cc:168
mysql::binlog::event::compression::type get_type() const
Gets the compression type that this object instance is tracking.
Definition: context.cc:69
uint64_t get_counter_transactions() const
Gets the number of transactions counted.
Definition: context.cc:73
log_type m_log_type
The log type.
Definition: context.h:70
Compression_stats_trx_row get_transaction_stats(enum_trx_type type)
This member function shall return the compression stats for the given transaction.
Definition: context.cc:86
mysql::binlog::event::compression::type m_type
The compression type.
Definition: context.h:75
uint64_t get_counter_uncompressed_bytes() const
Gets the sum of uncompressed bytes accounted for by this object instance.
Definition: context.cc:81
Compression_stats_trx_row get_first_transaction_stats()
Gets the stats of the first transaction.
Definition: context.cc:116
enum_trx_type
Enum stating whether FIRST or LAST transaction.
Definition: context.h:65
@ LAST
Definition: context.h:65
@ FIRST
Definition: context.h:65
log_type get_log_type() const
Gets the log type that this object instance is tracking.
Definition: context.cc:67
static const Compression_stats_trx_row & ZERO_TRX_ROW()
A constant and static instance of the transaction compression stats.
Definition: context.cc:36
Compression_stats_trx_row get_last_transaction_stats()
Gets the stats for the last transaction.
Definition: context.cc:111
virtual ~Compression_stats()
The destructor of this row.
Definition: context.cc:63
The global context for binary/relay log monitoring.
Definition: context.h:292
Transaction_compression m_transaction_compression_ctx
Definition: context.h:294
Context & operator=(const Context &rhs)=delete
Transaction_compression & transaction_compression()
Definition: context.cc:320
virtual ~Context()=default
Context(const Context &rhs)=delete
Definition: context.h:211
Transaction_compression()
Constructor.
Definition: context.cc:234
void reset()
Resets the stats of this probe to zero.
Definition: context.cc:270
int number_stats_rows()
Gets the number of stats in the probe.
Definition: context.cc:309
std::map< std::pair< log_type, mysql::binlog::event::compression::type >, Compression_stats * > m_stats
The map that contains rows of stats in the probe.
Definition: context.h:219
void update(log_type log_type, mysql::binlog::event::compression::type comp_type, Gtid >id, uint64_t transaction_timestamp, uint64_t comp_bytes, uint64_t uncomp_bytes, Tsid_map *tsid_map=global_tsid_map)
Update this probe's stats.
Definition: context.cc:275
void get_stats(std::vector< Compression_stats * > &stats)
Gets the contents of the probe.
Definition: context.cc:300
virtual ~Transaction_compression()
Destructor.
Definition: context.cc:239
void init()
Allocates this probe's internal structures.
Definition: context.cc:244
void destroy()
Claims this probe's internal resources.
Definition: context.cc:263
Binary log event definitions.
Tsid_map * global_tsid_map
Definition: mysqld.cc:1838
log_type
Definition: context.h:38
@ RELAY
Definition: context.h:38
@ BINARY
Definition: context.h:38
@ UKNOWN
Definition: context.h:38
type
Definition: base.h:40
@ NONE
Definition: base.h:45
required string type
Definition: replication_group_member_actions.proto:34
TODO: Move this structure to mysql/binlog/event/control_events.h when we start using C++11.
Definition: rpl_gtid.h:1101
Definition: mysqlslap.cc:240