Monitoring System 0.1.0
System resource monitoring with pluggable collectors and alerting
Loading...
Searching...
No Matches
kcenon::monitoring::scoped_span Class Reference

Scoped span for RAII-style span management. More...

#include <distributed_tracer.h>

Collaboration diagram for kcenon::monitoring::scoped_span:
Collaboration graph

Public Member Functions

 scoped_span (std::shared_ptr< trace_span > span, distributed_tracer *tracer)
 
 ~scoped_span ()
 
 scoped_span (const scoped_span &)=delete
 
scoped_spanoperator= (const scoped_span &)=delete
 
 scoped_span (scoped_span &&other) noexcept
 
scoped_spanoperator= (scoped_span &&other) noexcept
 
trace_spanoperator-> ()
 
const trace_spanoperator-> () const
 
trace_spanoperator* ()
 
const trace_spanoperator* () const
 

Private Attributes

std::shared_ptr< trace_spanspan_
 
distributed_tracertracer_
 

Detailed Description

Scoped span for RAII-style span management.

Definition at line 355 of file distributed_tracer.h.

Constructor & Destructor Documentation

◆ scoped_span() [1/3]

kcenon::monitoring::scoped_span::scoped_span ( std::shared_ptr< trace_span > span,
distributed_tracer * tracer )
inline

Definition at line 361 of file distributed_tracer.h.

362 : span_(span), tracer_(tracer) {
363 if (tracer_) {
365 }
366 }
void set_current_span(std::shared_ptr< trace_span > span)
Set current active span for this thread.
std::shared_ptr< trace_span > span_

References kcenon::monitoring::distributed_tracer::set_current_span(), span_, and tracer_.

Here is the call graph for this function:

◆ ~scoped_span()

kcenon::monitoring::scoped_span::~scoped_span ( )
inline

Definition at line 368 of file distributed_tracer.h.

368 {
369 if (span_ && tracer_) {
371 }
372 }
common::Result< bool > finish_span(std::shared_ptr< trace_span > span)
Finish a span.

References kcenon::monitoring::distributed_tracer::finish_span(), span_, and tracer_.

Here is the call graph for this function:

◆ scoped_span() [2/3]

kcenon::monitoring::scoped_span::scoped_span ( const scoped_span & )
delete

◆ scoped_span() [3/3]

kcenon::monitoring::scoped_span::scoped_span ( scoped_span && other)
inlinenoexcept

Definition at line 379 of file distributed_tracer.h.

380 : span_(std::move(other.span_)), tracer_(other.tracer_) {
381 other.tracer_ = nullptr;
382 }

References kcenon::monitoring::other.

Member Function Documentation

◆ operator*() [1/2]

trace_span & kcenon::monitoring::scoped_span::operator* ( )
inline

Definition at line 398 of file distributed_tracer.h.

398{ return *span_; }

References span_.

◆ operator*() [2/2]

const trace_span & kcenon::monitoring::scoped_span::operator* ( ) const
inline

Definition at line 399 of file distributed_tracer.h.

399{ return *span_; }

References span_.

◆ operator->() [1/2]

trace_span * kcenon::monitoring::scoped_span::operator-> ( )
inline

Definition at line 396 of file distributed_tracer.h.

396{ return span_.get(); }

References span_.

◆ operator->() [2/2]

const trace_span * kcenon::monitoring::scoped_span::operator-> ( ) const
inline

Definition at line 397 of file distributed_tracer.h.

397{ return span_.get(); }

References span_.

◆ operator=() [1/2]

scoped_span & kcenon::monitoring::scoped_span::operator= ( const scoped_span & )
delete

◆ operator=() [2/2]

scoped_span & kcenon::monitoring::scoped_span::operator= ( scoped_span && other)
inlinenoexcept

Definition at line 384 of file distributed_tracer.h.

384 {
385 if (this != &other) {
386 if (span_ && tracer_) {
388 }
389 span_ = std::move(other.span_);
390 tracer_ = other.tracer_;
391 other.tracer_ = nullptr;
392 }
393 return *this;
394 }

References kcenon::monitoring::distributed_tracer::finish_span(), kcenon::monitoring::other, span_, and tracer_.

Here is the call graph for this function:

Member Data Documentation

◆ span_

std::shared_ptr<trace_span> kcenon::monitoring::scoped_span::span_
private

◆ tracer_

distributed_tracer* kcenon::monitoring::scoped_span::tracer_
private

Definition at line 358 of file distributed_tracer.h.

Referenced by operator=(), scoped_span(), and ~scoped_span().


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