MySQL 9.1.0
Source Code Documentation
cs::apply::instruments::Applier_metrics Class Reference

This class contains metrics related to event and transaction scheduling activities in the replica MTA. More...

#include <applier_metrics.h>

Inheritance diagram for cs::apply::instruments::Applier_metrics:
[legend]

Public Member Functions

void start_applier_timer () override
 Starts the timer when the applier metrics collection began. More...
 
void stop_applier_timer () override
 Calculates the total time the applier ran. More...
 
int64_t get_last_applier_start_micros () const override
 Gets the time point when the metric timer started. More...
 
int64_t get_total_execution_time () const override
 Returns the total time the applier was running. More...
 
void inc_transactions_committed_count (int64_t amount) override
 increment the number of transactions committed. More...
 
int64_t get_transactions_committed_count () const override
 Gets the number of transactions committed. More...
 
void inc_transactions_received_count (int64_t amount) override
 increment the number of transactions pending. More...
 
int64_t get_transactions_received_count () const override
 Gets the number of transactions pending. More...
 
void inc_transactions_committed_size_sum (int64_t amount) override
 increment the size of transactions committed. More...
 
int64_t get_transactions_committed_size_sum () const override
 Gets the total sum of the size of committed transactions. More...
 
void inc_transactions_received_size_sum (int64_t amount) override
 increment the pending size of queued transactions. More...
 
int64_t get_transactions_received_size_sum () const override
 Gets the pending size sum of queued transactions. More...
 
void inc_events_committed_count (int64_t delta) override
 increment the number of events scheduled by a given amount. More...
 
int64_t get_events_committed_count () const override
 Gets the number of events scheduled. More...
 
void reset () override
 Resets the statistics to zero. More...
 
void set_metrics_breakpoint (const char *relay_log_filename) override
 Set the metrics breakpoint, if it has not already been set. More...
 
bool is_after_metrics_breakpoint () const override
 
void check_metrics_breakpoint (const char *relay_log_filename) override
 If we are before the metrics breakpoint, and the metrics breakpoint is equal to the given filename, remember that we are now after the metrics breakpoint. More...
 
Time_based_metric_interfaceget_work_from_source_wait_metric () override
 Returns time metrics for waits on work from the source. More...
 
Time_based_metric_interfaceget_workers_available_wait_metric () override
 Returns time metrics for waits on available workers. More...
 
Time_based_metric_interfaceget_transaction_dependency_wait_metric () override
 Returns time metrics for waits on transaction dependecies on workers. More...
 
Time_based_metric_interfaceget_worker_queues_memory_exceeds_max_wait_metric () override
 Returns time metrics for waits when a worker queue exceeds max memory. More...
 
Time_based_metric_interfaceget_worker_queues_full_wait_metric () override
 Returns time metrics for waits when the worker queues are full. More...
 
Time_based_metric_interfaceget_time_to_read_from_relay_log_metric () override
 Returns time metrics for relay log read wait times. More...
 
void inc_commit_order_wait_stored_metrics (int64_t count, int64_t time) override
 Increments the stored values for the commit order metrics. More...
 
int64_t get_number_of_waits_on_commit_order () const override
 Gets the stored number of times we waited on committed order. More...
 
int64_t get_wait_time_on_commit_order () const override
 Gets the stored summed time waited on commit order. More...
 
- Public Member Functions inherited from cs::apply::instruments::Applier_metrics_interface
virtual ~Applier_metrics_interface ()=default
 

Private Types

enum class  Metrics_breakpoint_state { unset , before , after }
 State of the metrics breakpoint. More...
 

Private Attributes

std::atomic< int64_t > m_last_applier_start_micros {}
 stats collection start timestamp More...
 
Time_based_metric m_sum_applier_execution_time
 total applier execution time More...
 
std::atomic_int64_t m_transactions_committed {0}
 Holds the counter of transactions committed. More...
 
std::atomic_int64_t m_transactions_received_count {0}
 Holds the counter of transactions currently pending. More...
 
std::string m_first_received_relay_log
 The first (oldest) relay log that the receiver wrote to after metric collection was enabled. More...
 
std::atomic< Metrics_breakpoint_statem_metrics_breakpoint_state
 True if the receiver has initialized m_first_received_relay_log. More...
 
std::atomic_int64_t m_transactions_committed_size_sum {0}
 Holds the total size of transactions committed till now. More...
 
std::atomic_int64_t m_transactions_received_size_sum {0}
 Holds the executed event's size of transactions now ongoing. More...
 
std::atomic_int64_t m_events_committed_count {0}
 Holds the counter of events scheduled. More...
 
Time_based_metric m_wait_for_work_from_source {true}
 Tracks the number and time waited for transactions to apply. More...
 
Time_based_metric m_wait_for_worker_available
 Tracks the number and time waited for transactions to apply. More...
 
Time_based_metric m_wait_for_transaction_dependency
 Tracks the number and time waited for transaction dependencies. More...
 
Time_based_metric m_wait_due_to_worker_queues_memory_exceeds_max
 Tracks the number and time waited for transaction dependencies. More...
 
Time_based_metric m_wait_due_to_worker_queue_full
 Tracks the number and time waited for transaction dependencies. More...
 
Time_based_metric m_time_to_read_from_relay_log
 Tracks the number and time waited for transaction dependencies. More...
 
std::atomic_int64_t m_order_commit_wait_count {0}
 The stored number of time waited for commit order. More...
 
std::atomic_int64_t m_order_commit_waited_time {0}
 The stored total amount of time waited for commit order. More...
 

Detailed Description

This class contains metrics related to event and transaction scheduling activities in the replica MTA.

Member Enumeration Documentation

◆ Metrics_breakpoint_state

State of the metrics breakpoint.

Enumerator
unset 

Breakpoint not set yet (nothing received).

before 

Breakpoint set by receiver; applier is positioned before it.

after 

Breakpoint set by receiver; applier is positioned after it.

Member Function Documentation

◆ check_metrics_breakpoint()

void cs::apply::instruments::Applier_metrics::check_metrics_breakpoint ( const char *  relay_log_filename)
overridevirtual

If we are before the metrics breakpoint, and the metrics breakpoint is equal to the given filename, remember that we are now after the metrics breakpoint.

Implements cs::apply::instruments::Applier_metrics_interface.

◆ get_events_committed_count()

int64_t cs::apply::instruments::Applier_metrics::get_events_committed_count ( ) const
overridevirtual

Gets the number of events scheduled.

Returns
the number of events scheduled.

Implements cs::apply::instruments::Applier_metrics_interface.

◆ get_last_applier_start_micros()

int64_t cs::apply::instruments::Applier_metrics::get_last_applier_start_micros ( ) const
overridevirtual

Gets the time point when the metric timer started.

Returns
The time point since the collection of statistics started.

Implements cs::apply::instruments::Applier_metrics_interface.

◆ get_number_of_waits_on_commit_order()

int64_t cs::apply::instruments::Applier_metrics::get_number_of_waits_on_commit_order ( ) const
overridevirtual

Gets the stored number of times we waited on committed order.

Returns
the stored number of commit order waits

Implements cs::apply::instruments::Applier_metrics_interface.

◆ get_time_to_read_from_relay_log_metric()

Time_based_metric_interface & cs::apply::instruments::Applier_metrics::get_time_to_read_from_relay_log_metric ( )
overridevirtual

Returns time metrics for relay log read wait times.

Returns
a Time_based_metric_interface object that contains metric information on a wait

Implements cs::apply::instruments::Applier_metrics_interface.

◆ get_total_execution_time()

int64_t cs::apply::instruments::Applier_metrics::get_total_execution_time ( ) const
overridevirtual

Returns the total time the applier was running.

Returns
Amount of time the applier threads were running for this channel

Implements cs::apply::instruments::Applier_metrics_interface.

◆ get_transaction_dependency_wait_metric()

Time_based_metric_interface & cs::apply::instruments::Applier_metrics::get_transaction_dependency_wait_metric ( )
overridevirtual

Returns time metrics for waits on transaction dependecies on workers.

Returns
a Time_based_metric_interface object that contains metric information on a wait

Implements cs::apply::instruments::Applier_metrics_interface.

◆ get_transactions_committed_count()

int64_t cs::apply::instruments::Applier_metrics::get_transactions_committed_count ( ) const
overridevirtual

Gets the number of transactions committed.

Returns
the number of transactions committed.

Implements cs::apply::instruments::Applier_metrics_interface.

◆ get_transactions_committed_size_sum()

int64_t cs::apply::instruments::Applier_metrics::get_transactions_committed_size_sum ( ) const
overridevirtual

Gets the total sum of the size of committed transactions.

Returns
the total size of committed transactions

Implements cs::apply::instruments::Applier_metrics_interface.

◆ get_transactions_received_count()

int64_t cs::apply::instruments::Applier_metrics::get_transactions_received_count ( ) const
overridevirtual

Gets the number of transactions pending.

Returns
the number of transactions waiting execution.

Implements cs::apply::instruments::Applier_metrics_interface.

◆ get_transactions_received_size_sum()

int64_t cs::apply::instruments::Applier_metrics::get_transactions_received_size_sum ( ) const
overridevirtual

Gets the pending size sum of queued transactions.

Returns
the exectuted size of pending transactions

Implements cs::apply::instruments::Applier_metrics_interface.

◆ get_wait_time_on_commit_order()

int64_t cs::apply::instruments::Applier_metrics::get_wait_time_on_commit_order ( ) const
overridevirtual

Gets the stored summed time waited on commit order.

Returns
the stored sum of the time waited on commit

Implements cs::apply::instruments::Applier_metrics_interface.

◆ get_work_from_source_wait_metric()

Time_based_metric_interface & cs::apply::instruments::Applier_metrics::get_work_from_source_wait_metric ( )
overridevirtual

Returns time metrics for waits on work from the source.

Returns
a Time_based_metric_interface object that contains metric information on a wait

Implements cs::apply::instruments::Applier_metrics_interface.

◆ get_worker_queues_full_wait_metric()

Time_based_metric_interface & cs::apply::instruments::Applier_metrics::get_worker_queues_full_wait_metric ( )
overridevirtual

Returns time metrics for waits when the worker queues are full.

Returns
a Time_based_metric_interface object that contains metric information on a wait

Implements cs::apply::instruments::Applier_metrics_interface.

◆ get_worker_queues_memory_exceeds_max_wait_metric()

Time_based_metric_interface & cs::apply::instruments::Applier_metrics::get_worker_queues_memory_exceeds_max_wait_metric ( )
overridevirtual

Returns time metrics for waits when a worker queue exceeds max memory.

Returns
a Time_based_metric_interface object that contains metric information on a wait

Implements cs::apply::instruments::Applier_metrics_interface.

◆ get_workers_available_wait_metric()

Time_based_metric_interface & cs::apply::instruments::Applier_metrics::get_workers_available_wait_metric ( )
overridevirtual

Returns time metrics for waits on available workers.

Returns
a Time_based_metric_interface object that contains metric information on a wait

Implements cs::apply::instruments::Applier_metrics_interface.

◆ inc_commit_order_wait_stored_metrics()

void cs::apply::instruments::Applier_metrics::inc_commit_order_wait_stored_metrics ( int64_t  count,
int64_t  time 
)
overridevirtual

Increments the stored values for the commit order metrics.

Parameters
countThe count for commit order waits
timeThe time waited on commit order

Implements cs::apply::instruments::Applier_metrics_interface.

◆ inc_events_committed_count()

void cs::apply::instruments::Applier_metrics::inc_events_committed_count ( int64_t  delta)
overridevirtual

increment the number of events scheduled by a given amount.

Parameters
deltathe amount of events to increment.

Implements cs::apply::instruments::Applier_metrics_interface.

◆ inc_transactions_committed_count()

void cs::apply::instruments::Applier_metrics::inc_transactions_committed_count ( int64_t  amount)
overridevirtual

increment the number of transactions committed.

Parameters
amountthe amount of transactions to increment.

Implements cs::apply::instruments::Applier_metrics_interface.

◆ inc_transactions_committed_size_sum()

void cs::apply::instruments::Applier_metrics::inc_transactions_committed_size_sum ( int64_t  amount)
overridevirtual

increment the size of transactions committed.

Parameters
amountthe size amount to increment.

Implements cs::apply::instruments::Applier_metrics_interface.

◆ inc_transactions_received_count()

void cs::apply::instruments::Applier_metrics::inc_transactions_received_count ( int64_t  amount)
overridevirtual

increment the number of transactions pending.

Parameters
amountthe amount of transactions to increment.

Implements cs::apply::instruments::Applier_metrics_interface.

◆ inc_transactions_received_size_sum()

void cs::apply::instruments::Applier_metrics::inc_transactions_received_size_sum ( int64_t  amount)
overridevirtual

increment the pending size of queued transactions.

Parameters
amountthe size amount to increment.

Implements cs::apply::instruments::Applier_metrics_interface.

◆ is_after_metrics_breakpoint()

bool cs::apply::instruments::Applier_metrics::is_after_metrics_breakpoint ( ) const
overridevirtual
Returns
true if the coordinator has advanced past the metrics breakpoint.

Implements cs::apply::instruments::Applier_metrics_interface.

◆ reset()

void cs::apply::instruments::Applier_metrics::reset ( )
overridevirtual

Resets the statistics to zero.

Implements cs::apply::instruments::Applier_metrics_interface.

◆ set_metrics_breakpoint()

void cs::apply::instruments::Applier_metrics::set_metrics_breakpoint ( const char *  relay_log_filename)
overridevirtual

Set the metrics breakpoint, if it has not already been set.

Parameters
relay_log_filenamerelay log name

Implements cs::apply::instruments::Applier_metrics_interface.

◆ start_applier_timer()

void cs::apply::instruments::Applier_metrics::start_applier_timer ( )
overridevirtual

Starts the timer when the applier metrics collection began.

Sets the state to running. This can be queried later to know for how long time the stats have been collected, i.e., the duration.

Implements cs::apply::instruments::Applier_metrics_interface.

◆ stop_applier_timer()

void cs::apply::instruments::Applier_metrics::stop_applier_timer ( )
overridevirtual

Calculates the total time the applier ran.

Sets the state to not running Sums to time since start to the total running time

Implements cs::apply::instruments::Applier_metrics_interface.

Member Data Documentation

◆ m_events_committed_count

std::atomic_int64_t cs::apply::instruments::Applier_metrics::m_events_committed_count {0}
private

Holds the counter of events scheduled.

◆ m_first_received_relay_log

std::string cs::apply::instruments::Applier_metrics::m_first_received_relay_log
private

The first (oldest) relay log that the receiver wrote to after metric collection was enabled.

◆ m_last_applier_start_micros

std::atomic<int64_t> cs::apply::instruments::Applier_metrics::m_last_applier_start_micros {}
private

stats collection start timestamp

◆ m_metrics_breakpoint_state

std::atomic<Metrics_breakpoint_state> cs::apply::instruments::Applier_metrics::m_metrics_breakpoint_state
private
Initial value:

True if the receiver has initialized m_first_received_relay_log.

◆ m_order_commit_wait_count

std::atomic_int64_t cs::apply::instruments::Applier_metrics::m_order_commit_wait_count {0}
private

The stored number of time waited for commit order.

◆ m_order_commit_waited_time

std::atomic_int64_t cs::apply::instruments::Applier_metrics::m_order_commit_waited_time {0}
private

The stored total amount of time waited for commit order.

◆ m_sum_applier_execution_time

Time_based_metric cs::apply::instruments::Applier_metrics::m_sum_applier_execution_time
private

total applier execution time

◆ m_time_to_read_from_relay_log

Time_based_metric cs::apply::instruments::Applier_metrics::m_time_to_read_from_relay_log
private

Tracks the number and time waited for transaction dependencies.

◆ m_transactions_committed

std::atomic_int64_t cs::apply::instruments::Applier_metrics::m_transactions_committed {0}
private

Holds the counter of transactions committed.

◆ m_transactions_committed_size_sum

std::atomic_int64_t cs::apply::instruments::Applier_metrics::m_transactions_committed_size_sum {0}
private

Holds the total size of transactions committed till now.

◆ m_transactions_received_count

std::atomic_int64_t cs::apply::instruments::Applier_metrics::m_transactions_received_count {0}
private

Holds the counter of transactions currently pending.

◆ m_transactions_received_size_sum

std::atomic_int64_t cs::apply::instruments::Applier_metrics::m_transactions_received_size_sum {0}
private

Holds the executed event's size of transactions now ongoing.

◆ m_wait_due_to_worker_queue_full

Time_based_metric cs::apply::instruments::Applier_metrics::m_wait_due_to_worker_queue_full
private

Tracks the number and time waited for transaction dependencies.

◆ m_wait_due_to_worker_queues_memory_exceeds_max

Time_based_metric cs::apply::instruments::Applier_metrics::m_wait_due_to_worker_queues_memory_exceeds_max
private

Tracks the number and time waited for transaction dependencies.

◆ m_wait_for_transaction_dependency

Time_based_metric cs::apply::instruments::Applier_metrics::m_wait_for_transaction_dependency
private

Tracks the number and time waited for transaction dependencies.

◆ m_wait_for_work_from_source

Time_based_metric cs::apply::instruments::Applier_metrics::m_wait_for_work_from_source {true}
private

Tracks the number and time waited for transactions to apply.

◆ m_wait_for_worker_available

Time_based_metric cs::apply::instruments::Applier_metrics::m_wait_for_worker_available
private

Tracks the number and time waited for transactions to apply.


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