Struct mz_adapter::explain_new::optimizer_trace::OptimizerTrace
source · pub(crate) struct OptimizerTrace(Dispatch);
Expand description
Provides functionality for tracing plans generated by the execution of an optimization pipeline.
Internally, this will create a layered tracing::subscriber::Subscriber
consisting of one layer for each supported plan type T
.
The OptimizerTrace::collect_trace
method on the created instance can be
then used to collect the trace, and OptimizerTrace::drain_all
to obtain
the collected trace as a vector of TraceEntry
instances.
Tuple Fields§
§0: Dispatch
Implementations§
source§impl OptimizerTrace
impl OptimizerTrace
sourcepub fn new() -> OptimizerTrace
pub fn new() -> OptimizerTrace
Create a new OptimizerTrace
.
sourcepub fn find(path: &'static str) -> OptimizerTrace
pub fn find(path: &'static str) -> OptimizerTrace
Create a new OptimizerTrace
that will only accumulate TraceEntry
instances along the prefix of the given path
.
sourcepub fn collect_trace<T>(&self, pipeline: impl FnOnce() -> T) -> T
pub fn collect_trace<T>(&self, pipeline: impl FnOnce() -> T) -> T
Run the given optimization pipeline
once and collect a trace of all
plans produced during that run.
sourcepub fn drain_all(
self,
format: ExplainFormat,
config: ExplainConfig,
catalog: ConnCatalog<'_>,
row_set_finishing: Option<RowSetFinishing>,
used_indexes: Vec<GlobalId>,
fast_path_plan: Option<FastPathPlan>
) -> Result<Vec<TraceEntry<String>>, ExplainError>
pub fn drain_all(
self,
format: ExplainFormat,
config: ExplainConfig,
catalog: ConnCatalog<'_>,
row_set_finishing: Option<RowSetFinishing>,
used_indexes: Vec<GlobalId>,
fast_path_plan: Option<FastPathPlan>
) -> Result<Vec<TraceEntry<String>>, ExplainError>
Collect all traced plans for all plan types T
that are available in
the wrapped dispatcher::Dispatch
.
sourcefn drain_explainable_entries<T>(
&self,
format: &ExplainFormat,
context: &ExplainContext<'_>,
fast_path_plan: &Option<String>
) -> Result<Vec<TraceEntry<String>>, ExplainError>where
T: Clone + Debug + 'static,
for<'a> Explainable<'a, T>: Explain<'a, Context = ExplainContext<'a>>,
fn drain_explainable_entries<T>(
&self,
format: &ExplainFormat,
context: &ExplainContext<'_>,
fast_path_plan: &Option<String>
) -> Result<Vec<TraceEntry<String>>, ExplainError>where
T: Clone + Debug + 'static,
for<'a> Explainable<'a, T>: Explain<'a, Context = ExplainContext<'a>>,
Collect all trace entries of a plan type T
that implements
Explainable
.
sourcefn drain_scalar_entries<T>(&self) -> Vec<TraceEntry<String>> ⓘwhere
T: Clone + Debug + 'static + DisplayText,
fn drain_scalar_entries<T>(&self) -> Vec<TraceEntry<String>> ⓘwhere
T: Clone + Debug + 'static + DisplayText,
Collect all trace entries of a plan type T
.
sourcefn drain_string_entries(&self) -> Vec<TraceEntry<String>> ⓘ
fn drain_string_entries(&self) -> Vec<TraceEntry<String>> ⓘ
Collect all trace entries with plans of type String
.
Auto Trait Implementations§
impl !RefUnwindSafe for OptimizerTrace
impl Send for OptimizerTrace
impl Sync for OptimizerTrace
impl Unpin for OptimizerTrace
impl !UnwindSafe for OptimizerTrace
Blanket Implementations§
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
source§fn into_rust(self) -> Result<R, TryFromProtoError>
fn into_rust(self) -> Result<R, TryFromProtoError>
RustType::from_proto
.source§fn from_rust(rust: &R) -> P
fn from_rust(rust: &R) -> P
RustType::into_proto
.