pub struct QueryDebug { /* private fields */ }Expand description
SPARQL arrival / completion / client-error logger.
Cheap to clone: the query-id counter is shared, so overlapping HTTP requests keep a single sequence.
Implementations§
Source§impl QueryDebug
impl QueryDebug
Sourcepub fn from_enabled(enabled: bool) -> Self
pub fn from_enabled(enabled: bool) -> Self
Sourcepub fn to_file(file: Arc<Mutex<File>>) -> Self
pub fn to_file(file: Arc<Mutex<File>>) -> Self
Log SPARQL arrivals, completions, and client errors to an
already-open file, and point the compute log/trace sinks at the same
file (the daemonized waratah start debug log).
Sourcepub fn received(&self, sparql: &str) -> QuerySpan
pub fn received(&self, sparql: &str) -> QuerySpan
Log that a SPARQL query arrived, including the full query text.
Always allocates a monotonic query_id so QueryContext can correlate
compute events even when this logger is off.
Sourcepub fn query_context(
&self,
span: &QuerySpan,
base: QueryContext,
) -> QueryContext
pub fn query_context( &self, span: &QuerySpan, base: QueryContext, ) -> QueryContext
Build the compute QueryContext for span: the engine’s own base
context plus the query id and, when --debug is on, the log/trace
sinks (stderr, or the daemon’s debug file).
base MUST come from the engine (see ComputeBackend::query_context).
Re-assembling a context here instead of deriving it drops everything
the engine knows: a None temporal epoch gates the temporal
comparison rewrite off entirely, so such a context would silently
answer every ?t >= const from the unindexed residual — right
answers, no index — with nothing to log. That is exactly the bug this
signature is shaped to prevent.
Sourcepub fn client_error(&self, error: ApiError) -> ApiError
pub fn client_error(&self, error: ApiError) -> ApiError
Log an HTTP error that never became a timed query (missing body, bad
content-type, and similar). Returns error unchanged for ? / return.
Trait Implementations§
Source§impl Clone for QueryDebug
impl Clone for QueryDebug
Source§fn clone(&self) -> QueryDebug
fn clone(&self) -> QueryDebug
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for QueryDebug
impl RefUnwindSafe for QueryDebug
impl Send for QueryDebug
impl Sync for QueryDebug
impl Unpin for QueryDebug
impl UnsafeUnpin for QueryDebug
impl UnwindSafe for QueryDebug
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].