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::ProfilingModeSetting Struct Reference

Public Types

using RETURN_TYPE = string

Static Public Member Functions

static void SetLocal (ClientContext &context, const Value &parameter)
static void ResetLocal (ClientContext &context)
static Value GetSetting (const ClientContext &context)

Static Public Attributes

static constexpr const char * Name = "profiling_mode"
static constexpr const char * Description = "The profiling mode (STANDARD or DETAILED)"
static constexpr const char * InputType = "VARCHAR"

Member Function Documentation

◆ SetLocal()

void duckdb::ProfilingModeSetting::SetLocal ( ClientContext & context,
const Value & parameter )
static
302738 {
302739 auto parameter = StringUtil::Lower(input.ToString());
302740 auto &config = ClientConfig::GetConfig(context);
302741 if (parameter == "standard") {
302742 config.enable_profiler = true;
302743 config.enable_detailed_profiling = false;
302744 } else if (parameter == "detailed") {
302745 config.enable_profiler = true;
302746 config.enable_detailed_profiling = true;
302747
302748 // add optimizer settings to the profiler settings
302749 auto optimizer_settings = MetricsUtils::GetOptimizerMetrics();
302750 for (auto &setting : optimizer_settings) {
302751 config.profiler_settings.insert(setting);
302752 }
302753
302754 // add the phase timing settings to the profiler settings
302755 auto phase_timing_settings = MetricsUtils::GetPhaseTimingMetrics();
302756 for (auto &setting : phase_timing_settings) {
302757 config.profiler_settings.insert(setting);
302758 }
302759 } else if (parameter == "all") {
302760 config.enable_profiler = true;
302761 auto all_metrics = MetricsUtils::GetAllMetrics();
302762 for (auto &metric : all_metrics) {
302763 config.profiler_settings.insert(metric);
302764 }
302765 } else {
302766 throw ParserException("Unrecognized profiling mode \"%s\", supported formats: [standard, detailed]", parameter);
302767 }
302768}
static DUCKDB_API string Lower(const string &str)
Convert a string to lowercase.
Definition duckdb.cpp:109630

◆ ResetLocal()

void duckdb::ProfilingModeSetting::ResetLocal ( ClientContext & context)
static
302770 {
302771 ClientConfig::GetConfig(context).enable_profiler = ClientConfig().enable_profiler;
302772 ClientConfig::GetConfig(context).enable_detailed_profiling = ClientConfig().enable_detailed_profiling;
302773 ClientConfig::GetConfig(context).emit_profiler_output = ClientConfig().emit_profiler_output;
302774 ClientConfig::GetConfig(context).profiler_settings = ClientConfig().profiler_settings;
302775}

◆ GetSetting()

Value duckdb::ProfilingModeSetting::GetSetting ( const ClientContext & context)
static
302777 {
302778 auto &config = ClientConfig::GetConfig(context);
302779 if (!config.enable_profiler) {
302780 return Value();
302781 }
302782 return Value(config.enable_detailed_profiling ? "detailed" : "standard");
302783}

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