nanoMMO 0.97.8
Building an MMO: The Engineering Series
Loading...
Searching...
No Matches
nanommo::Span Class Reference

#include <tracing.h>

Classes

struct  Data

Public Member Functions

 Span ()
 A span that records nothing.
 Span (std::unique_ptr< Data > data)
 ~Span ()
 Span (Span &&other) noexcept
 The span it was, which the other doesn't record any more.
 Span (const Span &)=delete
Span & operator= (const Span &)=delete
bool recording () const
SpanContext context () const
 No trace and no span when it isn't recording.
void SetAttribute (std::string_view key, std::string_view value)
void SetAttribute (std::string_view key, int64_t value)
void SetError (std::string_view message)
 Marks it as failed, and why.
void AddLink (const SpanContext &other)
void End ()

Detailed Description

A piece of a trace's work, from when it starts to when it ends, or goes out of scope. While it's open, it's its thread's current span, which the next span started on the thread is part of. A span started while tracing is off records nothing.

Definition at line 56 of file tracing.h.

Constructor & Destructor Documentation

◆ Span() [1/4]

nanommo::Span::Span ( )
default

A span that records nothing.

◆ Span() [2/4]

nanommo::Span::Span ( std::unique_ptr< Data > data)
explicit

Definition at line 301 of file tracing.cc.

◆ ~Span()

nanommo::Span::~Span ( )

Definition at line 308 of file tracing.cc.

◆ Span() [3/4]

nanommo::Span::Span ( Span && other)
defaultnoexcept

The span it was, which the other doesn't record any more.

◆ Span() [4/4]

nanommo::Span::Span ( const Span & )
delete

Member Function Documentation

◆ AddLink()

void nanommo::Span::AddLink ( const SpanContext & other)

Another trace's span that this one's work was for too, as a batch's span is for each message in it, and has one parent.

Definition at line 333 of file tracing.cc.

◆ context()

SpanContext nanommo::Span::context ( ) const

No trace and no span when it isn't recording.

Definition at line 310 of file tracing.cc.

◆ End()

void nanommo::Span::End ( )

Records it, and makes the span that was current before it current again. Going out of scope does the same.

Definition at line 339 of file tracing.cc.

◆ operator=()

Span & nanommo::Span::operator= ( const Span & )
delete

◆ recording()

bool nanommo::Span::recording ( ) const
inline

Definition at line 71 of file tracing.h.

◆ SetAttribute() [1/2]

void nanommo::Span::SetAttribute ( std::string_view key,
int64_t value )

Definition at line 320 of file tracing.cc.

◆ SetAttribute() [2/2]

void nanommo::Span::SetAttribute ( std::string_view key,
std::string_view value )

Definition at line 314 of file tracing.cc.

◆ SetError()

void nanommo::Span::SetError ( std::string_view message)

Marks it as failed, and why.

Definition at line 326 of file tracing.cc.


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