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::ProfilingInfo Class Reference
Collaboration diagram for duckdb::ProfilingInfo:

Public Member Functions

 ProfilingInfo (const profiler_settings_t &n_settings, const idx_t depth=0)
 
 ProfilingInfo (ProfilingInfo &)=default
 
ProfilingInfooperator= (ProfilingInfo const &)=default
 
void ResetMetrics ()
 
string GetMetricAsString (const MetricType metric) const
 
void WriteMetricsToLog (ClientContext &context)
 
void WriteMetricsToJSON (duckdb_yyjson::yyjson_mut_doc *doc, duckdb_yyjson::yyjson_mut_val *destination)
 
template<class METRIC_TYPE >
METRIC_TYPE GetMetricValue (const MetricType type) const
 
template<class METRIC_TYPE >
void MetricUpdate (const MetricType type, const Value &value, const std::function< METRIC_TYPE(const METRIC_TYPE &, const METRIC_TYPE &)> &update_fun)
 
template<class METRIC_TYPE >
void MetricUpdate (const MetricType type, const METRIC_TYPE &value, const std::function< METRIC_TYPE(const METRIC_TYPE &, const METRIC_TYPE &)> &update_fun)
 
template<class METRIC_TYPE >
void MetricSum (const MetricType type, const Value &value)
 
template<class METRIC_TYPE >
void MetricSum (const MetricType type, const METRIC_TYPE &value)
 
template<class METRIC_TYPE >
void MetricMax (const MetricType type, const Value &value)
 
template<class METRIC_TYPE >
void MetricMax (const MetricType type, const METRIC_TYPE &value)
 
template<>
InsertionOrderPreservingMap< string > GetMetricValue (const MetricType type) const
 

Static Public Member Functions

static bool Enabled (const profiler_settings_t &settings, const MetricType metric)
 Returns true, if the query profiler must collect this metric.
 
static void Expand (profiler_settings_t &settings, const MetricType metric)
 Expand metrics depending on the collection of other metrics.
 

Public Attributes

profiler_settings_t settings
 Enabling a metric adds it to this set.
 
profiler_settings_t expanded_settings
 This set contains the expanded to-be-collected metrics, which can differ from 'settings'.
 
profiler_metrics_t metrics
 Contains all enabled metrics.
 

Member Function Documentation

◆ GetMetricValue() [1/2]

template<class METRIC_TYPE >
METRIC_TYPE duckdb::ProfilingInfo::GetMetricValue ( const MetricType  type) const
inline
36326 {
36327 auto val = metrics.at(type);
36328 return val.GetValue<METRIC_TYPE>();
36329 }
profiler_metrics_t metrics
Contains all enabled metrics.
Definition duckdb.hpp:36304

◆ MetricUpdate() [1/2]

template<class METRIC_TYPE >
void duckdb::ProfilingInfo::MetricUpdate ( const MetricType  type,
const Value value,
const std::function< METRIC_TYPE(const METRIC_TYPE &, const METRIC_TYPE &)> &  update_fun 
)
inline
36333 {
36334 if (metrics.find(type) == metrics.end()) {
36335 metrics[type] = value;
36336 return;
36337 }
36338 auto new_value = update_fun(metrics[type].GetValue<METRIC_TYPE>(), value.GetValue<METRIC_TYPE>());
36339 metrics[type] = Value::CreateValue(new_value);
36340 }

◆ MetricUpdate() [2/2]

template<class METRIC_TYPE >
void duckdb::ProfilingInfo::MetricUpdate ( const MetricType  type,
const METRIC_TYPE value,
const std::function< METRIC_TYPE(const METRIC_TYPE &, const METRIC_TYPE &)> &  update_fun 
)
inline
36344 {
36345 auto new_value = Value::CreateValue(value);
36346 MetricUpdate<METRIC_TYPE>(type, new_value, update_fun);
36347 }

◆ MetricSum() [1/2]

template<class METRIC_TYPE >
void duckdb::ProfilingInfo::MetricSum ( const MetricType  type,
const Value value 
)
inline
36350 {
36351 MetricUpdate<METRIC_TYPE>(type, value, [](const METRIC_TYPE &old_value, const METRIC_TYPE &new_value) {
36352 return old_value + new_value;
36353 });
36354 }

◆ MetricSum() [2/2]

template<class METRIC_TYPE >
void duckdb::ProfilingInfo::MetricSum ( const MetricType  type,
const METRIC_TYPE value 
)
inline
36357 {
36358 auto new_value = Value::CreateValue(value);
36359 return MetricSum<METRIC_TYPE>(type, new_value);
36360 }

◆ MetricMax() [1/2]

template<class METRIC_TYPE >
void duckdb::ProfilingInfo::MetricMax ( const MetricType  type,
const Value value 
)
inline
36363 {
36364 MetricUpdate<METRIC_TYPE>(type, value, [](const METRIC_TYPE &old_value, const METRIC_TYPE &new_value) {
36365 return MaxValue(old_value, new_value);
36366 });
36367 }

◆ MetricMax() [2/2]

template<class METRIC_TYPE >
void duckdb::ProfilingInfo::MetricMax ( const MetricType  type,
const METRIC_TYPE value 
)
inline
36370 {
36371 auto new_value = Value::CreateValue(value);
36372 return MetricMax<METRIC_TYPE>(type, new_value);
36373 }

◆ GetMetricValue() [2/2]

template<>
InsertionOrderPreservingMap< string > duckdb::ProfilingInfo::GetMetricValue ( const MetricType  type) const
inline
36379 {
36380 auto val = metrics.at(type);
36381 InsertionOrderPreservingMap<string> result;
36382 auto children = MapValue::GetChildren(val);
36383 for (auto &child : children) {
36384 auto struct_children = StructValue::GetChildren(child);
36385 auto key = struct_children[0].GetValue<string>();
36386 auto value = struct_children[1].GetValue<string>();
36387 result.insert(key, value);
36388 }
36389 return result;
36390}

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