MySQL 8.4.2
Source Code Documentation
Metrics_handler Class Reference

#include <metrics_handler.h>

Public Types

enum class  enum_message_type { CONTROL , DATA }
 

Public Member Functions

 Metrics_handler ()=default
 
virtual ~Metrics_handler ()=default
 
void reset ()
 Reset the metrics. More...
 
uint64_t get_control_messages_sent_count () const
 Number of control messages sent by this member. More...
 
uint64_t get_data_messages_sent_count () const
 Number of messages that contain transaction data sent by this member. More...
 
uint64_t get_control_messages_sent_bytes_sum () const
 Sum of bytes of control messages sent by this member. More...
 
uint64_t get_data_messages_sent_bytes_sum () const
 Sum of bytes of messages that contain transaction data sent by this member. More...
 
uint64_t get_control_messages_sent_roundtrip_time_sum () const
 Sum of the roundtrip time in micro-seconds of control messages sent by this member. More...
 
uint64_t get_data_messages_sent_roundtrip_time_sum () const
 Sum of the roundtrip time in micro-seconds of messages that contain transaction data sent by this member. More...
 
uint64_t get_transactions_consistency_before_begin_count () const
 Number of transactions executed with group_replication_consistency=BEFORE or BEFORE_AND_AFTER. More...
 
uint64_t get_transactions_consistency_before_begin_time_sum () const
 Sum of the time that the member waited until its group_replication_applier channel was consumed before execute the transaction with group_replication_consistency=BEFORE or BEFORE_AND_AFTER. More...
 
uint64_t get_transactions_consistency_after_termination_count () const
 Number of transactions executed with group_replication_consistency=AFTER or BEFORE_AND_AFTER. More...
 
uint64_t get_transactions_consistency_after_termination_time_sum () const
 Sum of the time spent between the delivery of the transaction executed with group_replication_consistency= AFTER or BEFORE_AND_AFTER, and the acknowledge of the other group members that the transaction is prepared. More...
 
uint64_t get_transactions_consistency_after_sync_count () const
 Number of transactions executed with group_replication_consistency=AFTER or BEFORE_AND_AFTER. More...
 
uint64_t get_transactions_consistency_after_sync_time_sum () const
 Sum of the time that transactions on secondaries waited to start, while waiting for transactions from the primary with group_replication_consistency=AFTER or BEFORE_AND_AFTER to be committed. More...
 
uint64_t get_certification_garbage_collector_count () const
 Number of times certification garbage collection did run. More...
 
uint64_t get_certification_garbage_collector_time_sum () const
 Sum of the time that garbage collection runs took. More...
 
void add_message_sent (const Gcs_message &message)
 Account message sent. More...
 
void add_transaction_consistency_before_begin (const uint64_t begin_timestamp, const uint64_t end_timestamp)
 Account transaction that waited until its group_replication_applier channel was consumed before execute the transaction with group_replication_consistency=BEFORE or BEFORE_AND_AFTER. More...
 
void add_transaction_consistency_after_termination (const uint64_t begin_timestamp, const uint64_t end_timestamp)
 Account transaction executed with group_replication_consistency=AFTER or BEFORE_AND_AFTER that waited for the acknowledge of the other group members that the transaction is prepared. More...
 
void add_transaction_consistency_after_sync (const uint64_t begin_timestamp, const uint64_t end_timestamp)
 Account transaction that waited for transactions from the primary with group_replication_consistency=AFTER or BEFORE_AND_AFTER to be committed. More...
 
void add_garbage_collection_run (const uint64_t begin_timestamp, const uint64_t end_timestamp)
 Account a certification garbage collection run. More...
 

Static Public Member Functions

static uint64_t get_current_time ()
 Return time in microseconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC) More...
 

Private Member Functions

void add_message_sent_internal (const enum_message_type type, const uint64_t bytes, const uint64_t sent_timestamp, const uint64_t received_timestamp)
 Account message sent. More...
 

Private Attributes

std::atomic< uint64_t > m_control_messages_sent_count {0}
 
std::atomic< uint64_t > m_data_messages_sent_count {0}
 
std::atomic< uint64_t > m_control_messages_sent_bytes_sum {0}
 
std::atomic< uint64_t > m_data_messages_sent_bytes_sum {0}
 
std::atomic< uint64_t > m_control_messages_sent_roundtrip_time_sum {0}
 
std::atomic< uint64_t > m_data_messages_sent_roundtrip_time_sum {0}
 
std::atomic< uint64_t > m_transactions_consistency_before_begin_count {0}
 
std::atomic< uint64_t > m_transactions_consistency_before_begin_time_sum {0}
 
std::atomic< uint64_t > m_transactions_consistency_after_termination_count {0}
 
std::atomic< uint64_t > m_transactions_consistency_after_termination_time_sum
 
std::atomic< uint64_t > m_transactions_consistency_after_sync_count {0}
 
std::atomic< uint64_t > m_transactions_consistency_after_sync_time_sum {0}
 
std::atomic< uint64_t > m_certification_garbage_collector_count {0}
 
std::atomic< uint64_t > m_certification_garbage_collector_time_sum {0}
 

Member Enumeration Documentation

◆ enum_message_type

Enumerator
CONTROL 
DATA 

Constructor & Destructor Documentation

◆ Metrics_handler()

Metrics_handler::Metrics_handler ( )
default

◆ ~Metrics_handler()

virtual Metrics_handler::~Metrics_handler ( )
virtualdefault

Member Function Documentation

◆ add_garbage_collection_run()

void Metrics_handler::add_garbage_collection_run ( const uint64_t  begin_timestamp,
const uint64_t  end_timestamp 
)

Account a certification garbage collection run.

See also
Metrics_handler::get_current_time()
Parameters
begin_timestamptime on which the operation began.
end_timestamptime on which the operation ended.

◆ add_message_sent()

void Metrics_handler::add_message_sent ( const Gcs_message message)

Account message sent.

Parameters
messagethe message to be accounted.

◆ add_message_sent_internal()

void Metrics_handler::add_message_sent_internal ( const enum_message_type  type,
const uint64_t  bytes,
const uint64_t  sent_timestamp,
const uint64_t  received_timestamp 
)
private

Account message sent.

See also
Metrics_handler::get_current_time()
Parameters
typemessage type.
bytesmessage length.
sent_timestamptime on which the message was sent.
received_timestamptime on which the message was received.

◆ add_transaction_consistency_after_sync()

void Metrics_handler::add_transaction_consistency_after_sync ( const uint64_t  begin_timestamp,
const uint64_t  end_timestamp 
)

Account transaction that waited for transactions from the primary with group_replication_consistency=AFTER or BEFORE_AND_AFTER to be committed.

See also
Metrics_handler::get_current_time()
Parameters
begin_timestamptime on which the wait began.
end_timestamptime on which the wait ended.

◆ add_transaction_consistency_after_termination()

void Metrics_handler::add_transaction_consistency_after_termination ( const uint64_t  begin_timestamp,
const uint64_t  end_timestamp 
)

Account transaction executed with group_replication_consistency=AFTER or BEFORE_AND_AFTER that waited for the acknowledge of the other group members that the transaction is prepared.

See also
Metrics_handler::get_current_time()
Parameters
begin_timestamptime on which the wait began.
end_timestamptime on which the wait ended.

◆ add_transaction_consistency_before_begin()

void Metrics_handler::add_transaction_consistency_before_begin ( const uint64_t  begin_timestamp,
const uint64_t  end_timestamp 
)

Account transaction that waited until its group_replication_applier channel was consumed before execute the transaction with group_replication_consistency=BEFORE or BEFORE_AND_AFTER.

See also
Metrics_handler::get_current_time()
Parameters
begin_timestamptime on which the wait began.
end_timestamptime on which the wait ended.

◆ get_certification_garbage_collector_count()

uint64_t Metrics_handler::get_certification_garbage_collector_count ( ) const

Number of times certification garbage collection did run.

Returns
number of transactions.

◆ get_certification_garbage_collector_time_sum()

uint64_t Metrics_handler::get_certification_garbage_collector_time_sum ( ) const

Sum of the time that garbage collection runs took.

See also
Metrics_handler::get_current_time()
Returns
sum of the time.

◆ get_control_messages_sent_bytes_sum()

uint64_t Metrics_handler::get_control_messages_sent_bytes_sum ( ) const

Sum of bytes of control messages sent by this member.

The size is the over the wire size.

Returns
sum of bytes.

◆ get_control_messages_sent_count()

uint64_t Metrics_handler::get_control_messages_sent_count ( ) const

Number of control messages sent by this member.

Returns
number of messages.

◆ get_control_messages_sent_roundtrip_time_sum()

uint64_t Metrics_handler::get_control_messages_sent_roundtrip_time_sum ( ) const

Sum of the roundtrip time in micro-seconds of control messages sent by this member.

The time is measured between the send and the delivery of the message on the sender member.

See also
Metrics_handler::get_current_time()
Returns
sum of the roundtrip time.

◆ get_current_time()

static uint64_t Metrics_handler::get_current_time ( )
inlinestatic

Return time in microseconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC)

Returns
time in microseconds.

◆ get_data_messages_sent_bytes_sum()

uint64_t Metrics_handler::get_data_messages_sent_bytes_sum ( ) const

Sum of bytes of messages that contain transaction data sent by this member.

The size is the over the wire size.

Returns
sum of bytes.

◆ get_data_messages_sent_count()

uint64_t Metrics_handler::get_data_messages_sent_count ( ) const

Number of messages that contain transaction data sent by this member.

Returns
number of messages.

◆ get_data_messages_sent_roundtrip_time_sum()

uint64_t Metrics_handler::get_data_messages_sent_roundtrip_time_sum ( ) const

Sum of the roundtrip time in micro-seconds of messages that contain transaction data sent by this member.

The time is measured between the send and the delivery of the message on the sender member.

See also
Metrics_handler::get_current_time()
Returns
sum of the roundtrip time.

◆ get_transactions_consistency_after_sync_count()

uint64_t Metrics_handler::get_transactions_consistency_after_sync_count ( ) const

Number of transactions executed with group_replication_consistency=AFTER or BEFORE_AND_AFTER.

Returns
number of transactions.

◆ get_transactions_consistency_after_sync_time_sum()

uint64_t Metrics_handler::get_transactions_consistency_after_sync_time_sum ( ) const

Sum of the time that transactions on secondaries waited to start, while waiting for transactions from the primary with group_replication_consistency=AFTER or BEFORE_AND_AFTER to be committed.

See also
Metrics_handler::get_current_time()
Returns
sum of the wait time.

◆ get_transactions_consistency_after_termination_count()

uint64_t Metrics_handler::get_transactions_consistency_after_termination_count ( ) const

Number of transactions executed with group_replication_consistency=AFTER or BEFORE_AND_AFTER.

Returns
number of transactions.

◆ get_transactions_consistency_after_termination_time_sum()

uint64_t Metrics_handler::get_transactions_consistency_after_termination_time_sum ( ) const

Sum of the time spent between the delivery of the transaction executed with group_replication_consistency= AFTER or BEFORE_AND_AFTER, and the acknowledge of the other group members that the transaction is prepared.

See also
Metrics_handler::get_current_time()
Returns
sum of the wait time.

◆ get_transactions_consistency_before_begin_count()

uint64_t Metrics_handler::get_transactions_consistency_before_begin_count ( ) const

Number of transactions executed with group_replication_consistency=BEFORE or BEFORE_AND_AFTER.

Returns
number of transactions.

◆ get_transactions_consistency_before_begin_time_sum()

uint64_t Metrics_handler::get_transactions_consistency_before_begin_time_sum ( ) const

Sum of the time that the member waited until its group_replication_applier channel was consumed before execute the transaction with group_replication_consistency=BEFORE or BEFORE_AND_AFTER.

See also
Metrics_handler::get_current_time()
Returns
sum of the wait time.

◆ reset()

void Metrics_handler::reset ( )

Reset the metrics.

Member Data Documentation

◆ m_certification_garbage_collector_count

std::atomic<uint64_t> Metrics_handler::m_certification_garbage_collector_count {0}
private

◆ m_certification_garbage_collector_time_sum

std::atomic<uint64_t> Metrics_handler::m_certification_garbage_collector_time_sum {0}
private

◆ m_control_messages_sent_bytes_sum

std::atomic<uint64_t> Metrics_handler::m_control_messages_sent_bytes_sum {0}
private

◆ m_control_messages_sent_count

std::atomic<uint64_t> Metrics_handler::m_control_messages_sent_count {0}
private

◆ m_control_messages_sent_roundtrip_time_sum

std::atomic<uint64_t> Metrics_handler::m_control_messages_sent_roundtrip_time_sum {0}
private

◆ m_data_messages_sent_bytes_sum

std::atomic<uint64_t> Metrics_handler::m_data_messages_sent_bytes_sum {0}
private

◆ m_data_messages_sent_count

std::atomic<uint64_t> Metrics_handler::m_data_messages_sent_count {0}
private

◆ m_data_messages_sent_roundtrip_time_sum

std::atomic<uint64_t> Metrics_handler::m_data_messages_sent_roundtrip_time_sum {0}
private

◆ m_transactions_consistency_after_sync_count

std::atomic<uint64_t> Metrics_handler::m_transactions_consistency_after_sync_count {0}
private

◆ m_transactions_consistency_after_sync_time_sum

std::atomic<uint64_t> Metrics_handler::m_transactions_consistency_after_sync_time_sum {0}
private

◆ m_transactions_consistency_after_termination_count

std::atomic<uint64_t> Metrics_handler::m_transactions_consistency_after_termination_count {0}
private

◆ m_transactions_consistency_after_termination_time_sum

std::atomic<uint64_t> Metrics_handler::m_transactions_consistency_after_termination_time_sum
private
Initial value:
{
0}

◆ m_transactions_consistency_before_begin_count

std::atomic<uint64_t> Metrics_handler::m_transactions_consistency_before_begin_count {0}
private

◆ m_transactions_consistency_before_begin_time_sum

std::atomic<uint64_t> Metrics_handler::m_transactions_consistency_before_begin_time_sum {0}
private

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