Measures the execution time of the current code block, links it with the parent tracing::Spans and stores that info in the log.
More...
|
| Span (TracerPtr tracer, std::string name, const Span *parent, ReferenceType reference_type, logging::Level log_level=logging::Level::kInfo, utils::impl::SourceLocation source_location=utils::impl::SourceLocation::Current()) |
|
| Span (std::string name, ReferenceType reference_type=ReferenceType::kChild, logging::Level log_level=logging::Level::kInfo, utils::impl::SourceLocation source_location=utils::impl::SourceLocation::Current()) |
|
| Span (Span &&other) noexcept |
|
Span & | operator= (const Span &)=delete |
|
Span & | operator= (Span &&)=delete |
|
Span | CreateChild (std::string name) const |
|
Span | CreateFollower (std::string name) const |
|
ScopeTime | CreateScopeTime () |
| Creates a tracing::ScopeTime attached to the span.
|
|
ScopeTime | CreateScopeTime (std::string name) |
| Creates a tracing::ScopeTime attached to the Span and starts measuring execution time.
|
|
ScopeTime::Duration | GetTotalDuration (const std::string &scope_name) const |
|
ScopeTime::DurationMillis | GetTotalElapsedTime (const std::string &scope_name) const |
|
void | AddTag (std::string key, logging::LogExtra::Value value) |
|
void | AddTagFrozen (std::string key, logging::LogExtra::Value value) |
|
void | AddNonInheritableTag (std::string key, logging::LogExtra::Value value) |
|
void | SetLogLevel (logging::Level log_level) |
| Sets level for tags logging.
|
|
logging::Level | GetLogLevel () const |
| Returns level for tags logging.
|
|
void | SetLocalLogLevel (std::optional< logging::Level > log_level) |
| Sets the local log level that disables logging of this span if the local log level set and greater than the main log level of the Span.
|
|
std::optional< logging::Level > | GetLocalLogLevel () const |
| Returns the local log level that disables logging of this span if it is set and greater than the main log level of the Span.
|
|
void | SetLink (std::string link) |
| Set link. Can be called only once.
|
|
void | SetParentLink (std::string parent_link) |
| Set parent_link. Can be called only once.
|
|
std::string | GetLink () const |
|
std::string | GetParentLink () const |
|
const std::string & | GetTraceId () const |
|
const std::string & | GetSpanId () const |
|
const std::string & | GetParentId () const |
|
bool | ShouldLogDefault () const noexcept |
|
void | DetachFromCoroStack () |
|
void | AttachToCoroStack () |
|
std::chrono::system_clock::time_point | GetStartSystemTime () const |
|
Measures the execution time of the current code block, links it with the parent tracing::Spans and stores that info in the log.
See Logging and Tracing for usage examples and more descriptions.
- Warning
- Shall be created only as a local variable. Do not use it as a class member!
- Examples
- samples/tcp_full_duplex_service/tcp_full_duplex_service.cpp.
Definition at line 30 of file span.hpp.