Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb::QueryMetrics Struct Reference
Collaboration diagram for duckdb::QueryMetrics:

Public Member Functions

void UpdateMetric (const MetricType metric, idx_t addition)
 
idx_t GetMetricValue (const MetricType metric) const
 
double GetMetricInSeconds (const MetricType metric) const
 
void Reset ()
 
void Merge (const QueryMetrics &other)
 

Static Public Member Functions

static idx_t GetMetricsIndex (MetricType type)
 

Public Attributes

ProfilingInfo query_global_info
 
std::string query_name
 
unique_ptr< ActiveTimerlatency_timer
 

Private Attributes

atomic< idx_tactive_metrics [ACTIVELY_TRACKED_METRICS]
 

Static Private Attributes

static constexpr const idx_t ACTIVELY_TRACKED_METRICS = 11
 

Constructor & Destructor Documentation

◆ QueryMetrics()

duckdb::QueryMetrics::QueryMetrics ( )
inline
36589 {
36590 Reset();
36591 }

Member Function Documentation

◆ UpdateMetric()

void duckdb::QueryMetrics::UpdateMetric ( const MetricType  metric,
idx_t  addition 
)
inline
36599 {
36600 active_metrics[GetMetricsIndex(metric)] += addition;
36601 }

◆ GetMetricValue()

idx_t duckdb::QueryMetrics::GetMetricValue ( const MetricType  metric) const
inline
36603 {
36604 return active_metrics[GetMetricsIndex(metric)];
36605 }

◆ GetMetricInSeconds()

double duckdb::QueryMetrics::GetMetricInSeconds ( const MetricType  metric) const
inline
36607 {
36608 return static_cast<double>(active_metrics[GetMetricsIndex(metric)]) / 1e9;
36609 }

◆ Reset()

void duckdb::QueryMetrics::Reset ( )
inline
36611 {
36612 for(idx_t i = 0; i < ACTIVELY_TRACKED_METRICS; i++) {
36613 active_metrics[i] = 0;
36614 }
36615
36616 latency_timer.reset();
36617 query_name = "";
36618 }

◆ Merge()

void duckdb::QueryMetrics::Merge ( const QueryMetrics other)
inline
36620 {
36621 for(idx_t i = 0; i < ACTIVELY_TRACKED_METRICS; i++) {
36622 active_metrics[i] += other.active_metrics[i];
36623 }
36624 }

◆ GetMetricsIndex()

static idx_t duckdb::QueryMetrics::GetMetricsIndex ( MetricType  type)
inlinestatic
36626 {
36627 switch(type) {
36628 case MetricType::ATTACH_LOAD_STORAGE_LATENCY: return 0;
36629 case MetricType::ATTACH_REPLAY_WAL_LATENCY: return 1;
36630 case MetricType::CHECKPOINT_LATENCY: return 2;
36631 case MetricType::COMMIT_LOCAL_STORAGE_LATENCY: return 3;
36632 case MetricType::LATENCY: return 4;
36633 case MetricType::WAITING_TO_ATTACH_LATENCY: return 5;
36634 case MetricType::WRITE_TO_WAL_LATENCY: return 6;
36635 case MetricType::TOTAL_BYTES_READ: return 7;
36636 case MetricType::TOTAL_BYTES_WRITTEN: return 8;
36637 case MetricType::TOTAL_MEMORY_ALLOCATED: return 9;
36638 case MetricType::WAL_REPLAY_ENTRY_COUNT: return 10;
36639 default:
36640 throw InternalException("MetricType %s is not actively tracked.", EnumUtil::ToString(type));
36641 }
36642 }

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