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

#include <zipkin.hpp>

Classes

class  impl
 

Public Member Functions

 zipkin (const std::string &url, const std::string &service_name, uint32_t timeout_us)
 
 ~zipkin ()=default
 finishes logging all queued up spans
 
uint64_t get_next_unique_id ()
 Starts with a random id and increments on each call, will not return 0.
 
void shutdown ()
 
void log (zipkin_span::span_data &&span)
 

Detailed Description

Definition at line 175 of file zipkin.hpp.

Constructor & Destructor Documentation

◆ zipkin()

fc::zipkin::zipkin ( const std::string & url,
const std::string & service_name,
uint32_t timeout_us )

Definition at line 102 of file zipkin.cpp.

102 :
103 my( new impl( url, service_name, timeout_us ) ) {
104 my->init();
105}
string url
Definition main.cpp:166

◆ ~zipkin()

fc::zipkin::~zipkin ( )
default

Member Function Documentation

◆ get_next_unique_id()

uint64_t fc::zipkin::get_next_unique_id ( )

Definition at line 107 of file zipkin.cpp.

107 {
108 std::scoped_lock g( my->mtx );
109 if( my->next_id == 0 ) {
110 std::mt19937_64 engine( std::random_device{}() );
111 std::uniform_int_distribution<uint64_t> distribution(1);
112 my->next_id = distribution( engine );
113 }
114 return my->next_id++;
115}
Here is the caller graph for this function:

◆ log()

void fc::zipkin::log ( zipkin_span::span_data && span)

Definition at line 158 of file zipkin.cpp.

158 {
159 if( my->consecutive_errors > my->max_consecutive_errors || my->stopped )
160 return;
161
162 boost::asio::post(my->work_strand, [this, span{std::move(span)}]() mutable {
163 my->log( std::move( span ) );
164 });
165}
Here is the caller graph for this function:

◆ shutdown()

void fc::zipkin::shutdown ( )

Definition at line 117 of file zipkin.cpp.

117 {
118 my->shutdown();
119}
Here is the caller graph for this function:

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