![]() |
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.
|
QueryProfiler collects the profiling metrics of a query. More...

Public Types | |
| using | TreeMap = reference_map_t< const PhysicalOperator, reference< ProfilingNode > > |
Public Member Functions | |
| DUCKDB_API | QueryProfiler (ClientContext &context) |
| DUCKDB_API bool | IsEnabled () const |
| DUCKDB_API bool | IsDetailedEnabled () const |
| DUCKDB_API ProfilerPrintFormat | GetPrintFormat (ExplainFormat format=ExplainFormat::DEFAULT) const |
| DUCKDB_API bool | PrintOptimizerOutput () const |
| DUCKDB_API string | GetSaveLocation () const |
| DUCKDB_API void | Start (const string &query) |
| DUCKDB_API void | Reset () |
| DUCKDB_API void | StartQuery (const string &query, bool is_explain_analyze=false, bool start_at_optimizer=false) |
| DUCKDB_API void | EndQuery () |
| DUCKDB_API void | FinalizeMetrics () |
| Finalize query metrics for output; safe to call multiple times. | |
| DUCKDB_API void | AddToCounter (MetricType type, const idx_t amount) |
| Adds amount to a specific metric type. | |
| DUCKDB_API ActiveTimer | StartTimer (MetricType type) |
| Start/End a timer for a specific metric type. | |
| DUCKDB_API void | StartExplainAnalyze () |
| DUCKDB_API void | Flush (OperatorProfiler &profiler) |
| Adds the timings gathered by an OperatorProfiler to this query profiler. | |
| DUCKDB_API void | SetBlockedTime (const double &blocked_thread_time) |
| Adds the top level query information to the global profiler. | |
| DUCKDB_API void | StartPhase (MetricType phase_metric) |
| DUCKDB_API void | EndPhase () |
| DUCKDB_API void | Initialize (const PhysicalOperator &root) |
| DUCKDB_API string | QueryTreeToString () const |
| DUCKDB_API void | QueryTreeToStream (std::ostream &str) const |
| DUCKDB_API void | Print () |
| DUCKDB_API string | ToString (ExplainFormat format=ExplainFormat::DEFAULT) const |
| DUCKDB_API string | ToString (ProfilerPrintFormat format) const |
| DUCKDB_API void | ToLog () const |
| DUCKDB_API string | ToJSON () const |
| DUCKDB_API void | WriteToFile (const char *path, string &info) const |
| DUCKDB_API idx_t | GetBytesRead () const |
| DUCKDB_API idx_t | GetBytesWritten () const |
| idx_t | OperatorSize () |
| void | Finalize (ProfilingNode &node) |
| optional_ptr< ProfilingNode > | GetRoot () |
| Return the root of the query tree. | |
| DUCKDB_API void | GetRootUnderLock (const std::function< void(optional_ptr< ProfilingNode >)> &callback) |
| const TreeMap & | GetTreeMap () const |
Static Public Member Functions | |
| static DUCKDB_API QueryProfiler & | Get (ClientContext &context) |
| static Value | JSONSanitize (const Value &input) |
| static string | JSONSanitize (const string &text) |
| static string | DrawPadded (const string &str, idx_t width) |
Private Types | |
| using | PhaseTimingStorage = unordered_map< MetricType, double, MetricTypeHashFunction > |
| A mapping of the phase names to the timings. | |
| using | PhaseTimingItem = PhaseTimingStorage::value_type |
Private Member Functions | |
| unique_ptr< ProfilingNode > | CreateTree (const PhysicalOperator &root, const profiler_settings_t &settings, const idx_t depth=0) |
| void | Render (const ProfilingNode &node, std::ostream &str) const |
| string | RenderDisabledMessage (ProfilerPrintFormat format) const |
| void | MoveOptimizerPhasesToRoot () |
| void | FinalizeMetricsInternal () |
| bool | OperatorRequiresProfiling (const PhysicalOperatorType op_type) |
| ExplainFormat | GetExplainFormat (ProfilerPrintFormat format) const |
Private Attributes | |
| ClientContext & | context |
| bool | running |
| Whether or not the query profiler is running. | |
| std::mutex | lock |
| The lock used for accessing the global query profiler or flushing information to it from a thread. | |
| bool | query_requires_profiling |
| Whether or not the query requires profiling. | |
| unique_ptr< ProfilingNode > | root |
| The root of the query tree. | |
| QueryMetrics | query_metrics |
| Top level query information. | |
| TreeMap | tree_map |
| A map of a Physical Operator pointer to a tree node. | |
| bool | is_explain_analyze |
| Whether or not we are running as part of a explain_analyze query. | |
| bool | metrics_finalized |
| Whether root metrics have been finalized for output. | |
| Profiler | phase_profiler |
| The timer used to time the individual phases of the planning process. | |
| PhaseTimingStorage | phase_timings |
| vector< MetricType > | phase_stack |
| The stack of currently active phases. | |
QueryProfiler collects the profiling metrics of a query.
| DUCKDB_API string duckdb::QueryProfiler::ToString | ( | ExplainFormat | format = ExplainFormat::DEFAULT | ) | const |
return the printed as a string. Unlike ToString, which is always formatted as a string, the return value is formatted based on the current print format (see GetPrintFormat()).


|
inline |
|
inline |
Return the root of the query tree.

|
inline |
Provides access to the root of the query tree, but ensures there are no concurrent modifications. This can be useful when implementing continuous profiling or making customizations.

|
private |
Check whether or not an operator type requires query profiling. If none of the ops in a query require profiling no profiling information is output.