24#ifndef BINLOG_MONITORING_CONTEXT_H
25#define BINLOG_MONITORING_CONTEXT_H
53 std::tuple<std::string, uint64_t, uint64_t, uint64_t>;
160 void add(std::string gtid, uint64_t transaction_timestamp,
161 uint64_t comp_bytes, uint64_t uncomp_bytes);
216 std::map<std::pair<log_type, mysql::binlog::event::compression::type>,
246 uint64_t transaction_timestamp, uint64_t comp_bytes,
Represents a bidirectional map between TSID and SIDNO.
Definition: rpl_gtid.h:748
This class represents the compression stats collected for a given combination of log type and compres...
Definition: context.h:43
void reset()
This member function shall reset the counters to zero and clear the transaction stats for both FIRST ...
Definition: context.cc:184
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:121
std::atomic< uint64_t > m_counter_compressed_bytes
Sum of all compressed bytes for all transactions observed through this object instance.
Definition: context.h:86
std::atomic< uint64_t > m_counter_transactions
Counter that tracks how many transactions have been observed.
Definition: context.h:80
std::atomic< Compression_stats_trx_row * > m_last_transaction_stats
This tuple contains information about the last transaction.
Definition: context.h:102
std::atomic< Compression_stats_trx_row * > m_first_transaction_stats
This tuple contains information about the first transaction.
Definition: context.h:97
uint64_t get_counter_compressed_bytes() const
Gets the sum of compressed bytes accounted for by this object instance.
Definition: context.cc:76
void destroy()
This member function shall destroy the object data structures.
Definition: context.cc:226
std::atomic< uint64_t > m_counter_uncompressed_bytes
Sum of all uncompressed bytes for all transactions observed through this object instance.
Definition: context.h:92
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:53
void destroy_transaction_stats(enum_trx_type type)
This member function shall claim memory used for tracking transaction stats.
Definition: context.cc:167
mysql::binlog::event::compression::type get_type() const
Gets the compression type that this object instance is tracking.
Definition: context.cc:68
uint64_t get_counter_transactions() const
Gets the number of transactions counted.
Definition: context.cc:72
log_type m_log_type
The log type.
Definition: context.h:69
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:85
mysql::binlog::event::compression::type m_type
The compression type.
Definition: context.h:74
uint64_t get_counter_uncompressed_bytes() const
Gets the sum of uncompressed bytes accounted for by this object instance.
Definition: context.cc:80
Compression_stats_trx_row get_first_transaction_stats()
Gets the stats of the first transaction.
Definition: context.cc:115
enum_trx_type
Enum stating whether FIRST or LAST transaction.
Definition: context.h:64
@ LAST
Definition: context.h:64
@ FIRST
Definition: context.h:64
log_type get_log_type() const
Gets the log type that this object instance is tracking.
Definition: context.cc:66
static const Compression_stats_trx_row & ZERO_TRX_ROW()
A constant and static instance of the transaction compression stats.
Definition: context.cc:35
Compression_stats_trx_row get_last_transaction_stats()
Gets the stats for the last transaction.
Definition: context.cc:110
virtual ~Compression_stats()
The destructor of this row.
Definition: context.cc:62
The global context for binary/relay log monitoring.
Definition: context.h:291
Transaction_compression m_transaction_compression_ctx
Definition: context.h:293
Context & operator=(const Context &rhs)=delete
Transaction_compression & transaction_compression()
Definition: context.cc:319
virtual ~Context()=default
Context(const Context &rhs)=delete
Definition: context.h:210
Transaction_compression()
Constructor.
Definition: context.cc:233
void reset()
Resets the stats of this probe to zero.
Definition: context.cc:269
int number_stats_rows()
Gets the number of stats in the probe.
Definition: context.cc:308
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:218
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:274
void get_stats(std::vector< Compression_stats * > &stats)
Gets the contents of the probe.
Definition: context.cc:299
virtual ~Transaction_compression()
Destructor.
Definition: context.cc:238
void init()
Allocates this probe's internal structures.
Definition: context.cc:243
void destroy()
Claims this probe's internal resources.
Definition: context.cc:262
Binary log event definitions.
Tsid_map * global_tsid_map
Definition: mysqld.cc:1839
log_type
Definition: context.h:37
@ RELAY
Definition: context.h:37
@ BINARY
Definition: context.h:37
@ UKNOWN
Definition: context.h:37
type
Definition: base.h:39
@ NONE
Definition: base.h:44
required string type
Definition: replication_group_member_actions.proto:33
TODO: Move this structure to mysql/binlog/event/control_events.h when we start using C++11.
Definition: rpl_gtid.h:1099
Definition: mysqlslap.cc:239