Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
fc::zipkin_config Class Reference

#include <zipkin.hpp>

Static Public Member Functions

static bool is_enabled ()
 Thread safe only if init() called from main thread before spawning of any threads.
 
static void init (const std::string &url, const std::string &service_name, uint32_t timeout_us)
 
static zipkinget_zipkin ()
 
static void shutdown ()
 
static uint64_t get_next_unique_id ()
 Starts with a random id and increments on each call, will not return 0.
 

Detailed Description

Definition at line 26 of file zipkin.hpp.

Member Function Documentation

◆ get_next_unique_id()

uint64_t fc::zipkin_config::get_next_unique_id ( )
static

Definition at line 39 of file zipkin.cpp.

39 {
40 if( !get().zip ) {
41 FC_THROW_EXCEPTION( fc::assert_exception, "uninitialized zipkin" );
42 }
43 return get().zip->get_next_unique_id();
44}
#define FC_THROW_EXCEPTION(EXCEPTION, FORMAT,...)
Here is the call graph for this function:

◆ get_zipkin()

zipkin & fc::zipkin_config::get_zipkin ( )
static

Thread safe only if init() called from main thread before spawning of any threads

Exceptions
assert_exceptionif called before init()

Definition at line 26 of file zipkin.cpp.

26 {
27 if( !get().zip ) {
28 FC_THROW_EXCEPTION( fc::assert_exception, "uninitialized zipkin" );
29 }
30 return *get().zip;
31}
Here is the caller graph for this function:

◆ init()

void fc::zipkin_config::init ( const std::string & url,
const std::string & service_name,
uint32_t timeout_us )
static

Not thread safe, call from main thread before spawning any threads that might use zipkin.

Parameters
urlthe url endpoint of zipkin server. e.g. http://127.0.0.1:9411/api/v2/spans
service_namethe service name to include in each zipkin span
timeout_usthe timeout in microseconds for each http call (9 consecutive failures and zipkin is disabled)

Definition at line 22 of file zipkin.cpp.

22 {
23 get().zip = std::make_unique<zipkin>( url, service_name, timeout_us );
24}
string url
Definition main.cpp:166

◆ is_enabled()

static bool fc::zipkin_config::is_enabled ( )
inlinestatic

Definition at line 29 of file zipkin.hpp.

29{ return get_zipkin_() != nullptr; }
Here is the caller graph for this function:

◆ shutdown()

void fc::zipkin_config::shutdown ( )
static

Thread safe only if init() called from main thread before spawning of any threads

Exceptions
assert_exceptionif called before init()

Definition at line 33 of file zipkin.cpp.

33 {
34 if( zipkin* z = get_zipkin_() ) {
35 z->shutdown();
36 }
37}

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