MySQL 9.1.0
Source Code Documentation
aggregated_stats Struct Reference

To facilitate calculating values of status variables aggregated per all THDs in real-time, each THD will update its stats into a matching buffer shard. More...

#include <aggregated_stats.h>

Public Member Functions

aggregated_stats_bufferget_shard (my_thread_id thread_id)
 
void flush ()
 
void get_total (aggregated_stats_buffer &result)
 
uint64_t get_single_total (size_t offset)
 

Static Public Attributes

constexpr static size_t STAT_SHARD_COUNT = 64
 

Protected Attributes

aggregated_stats_buffer shards_ [STAT_SHARD_COUNT]
 

Detailed Description

To facilitate calculating values of status variables aggregated per all THDs in real-time, each THD will update its stats into a matching buffer shard.

Later we will aggregate the values accross all the shards to get the final values.

This mechanism avoids possible contentions if all THDs would write directly to a single shared global buffer.

Member Function Documentation

◆ flush()

void aggregated_stats::flush ( )

◆ get_shard()

aggregated_stats_buffer & aggregated_stats::get_shard ( my_thread_id  thread_id)
inline

◆ get_single_total()

uint64_t aggregated_stats::get_single_total ( size_t  offset)

◆ get_total()

void aggregated_stats::get_total ( aggregated_stats_buffer result)

Member Data Documentation

◆ shards_

aggregated_stats_buffer aggregated_stats::shards_[STAT_SHARD_COUNT]
protected

◆ STAT_SHARD_COUNT

constexpr static size_t aggregated_stats::STAT_SHARD_COUNT = 64
staticconstexpr

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