A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/jaeger__tracer_8cpp_source.html below:

NCBI C++ ToolKit: src/corelib/jaeger/jaeger_tracer.cpp Source File

38 #define INCL_EXTRA_HTON_FUNCTIONS 43 #include <jaegertracing/Tracer.h> 46 #define NCBI_USE_ERRCODE_X Corelib_Diag 52  const

jaegertracing::Config&

config

)

55  if

(jaegertracing::Tracer::IsGlobalTracerRegistered())

return

;

57  if

(jaegertracing::Tracer::IsGlobalTracerRegistered())

return

;

59  auto

tracer = service_name.empty() ?

60

jaegertracing::Tracer::make(

config

) :

61

jaegertracing::Tracer::make(service_name,

config

);

62

jaegertracing::Tracer::InitGlobal(

63

std::static_pointer_cast<jaegertracing::Tracer>(tracer));

69

jaegertracing::Config

config

(

72

jaegertracing::samplers::Config(jaegertracing::kSamplerTypeConst, 1),

73

jaegertracing::reporters::Config(

74

jaegertracing::reporters::Config::kDefaultQueueSize,

75

jaegertracing::reporters::Config::defaultBufferFlushInterval(),

85  string

service_name =

"no-service-name"

;

88  if

( guard ) service_name = guard->GetProgramDisplayName();

102  const

jaegertracing::Config&

config

)

118

h1 = c + (h1 << 5) + h1;

119

h2 = c + (h2 << 6) + (h2 << 16) - h2;

130

h = c + (h << 6) + (h << 16) - h;

144  string

phid =

context

.GetHitID();

145  size_t

dot = phid.find_first_of(

'.'

);

146  string

base_phid = phid.substr(0, dot);

148  id_hash

(base_phid, trace_id_high, trace_id_low);

153

dot = phid.find_last_of(

'.'

);

154  if

(dot != string::npos && phid.size() > dot) {

155  id_hash

(phid.substr(0, dot), parent_span_id);

158

jaegertracing::TraceID trace_id(trace_id_high, trace_id_low);

159

unique_ptr<jaegertracing::SpanContext> span_context(

new

jaegertracing::SpanContext(

163

(

unsigned char

)jaegertracing::SpanContext::Flag::kSampled,

165  auto

tracer = dynamic_pointer_cast<const jaegertracing::Tracer>(opentracing::Tracer::Global());

166

shared_ptr<jaegertracing::Span> span(

new

jaegertracing::Span(

167

tracer, *span_context, tracer->serviceName()));

169

span->SetTag(

"ncbi_phid"

, phid);

170

span->SetTag(

"session_id"

,

context

.GetSessionID());

171

span->SetTag(

"request_id"

,

context

.GetRequestID());

172

span->SetTag(

"client_ip"

,

context

.GetClientIP());

176

span->SetTag(

"guid"

,

buf

);

177

span->SetTag(

"pid"

, diag_context.

GetPID

());

179

span->SetTag(

"host"

, diag_context.

GetHost

());

184  auto

jctx =

dynamic_cast<const

jaegertracing::SpanContext*

>

(&span->context());

185  if

(jctx !=

nullptr

) {

187

jctx->traceID().print(trace_str);

188

span_str <<

hex

<< jctx->spanID();

190

.

Print

(

"jaeger_trace_id"

, trace_str.str())

191

.

Print

(

"jaeger_span_id"

, span_str.str());

193  context

.SetTracerSpan(make_shared<CJaegerTracerSpan>(span));

202  context

.SetTracerSpan(

nullptr

);

253  switch

(header_type) {

static CNcbiApplicationGuard InstanceGuard(void)

Singleton method.

void SetHttpHeader(EHttpHeaderType header_type, const string &name, const string &value) override

CJaegerTracer(void)

Create tracer using default settings:

CDiagContext_Extra & Print(const string &name, const string &value)

The method does not print the argument, but adds it to the string.

const string & GetHost(void) const

Get host name.

string GetStringUID(TUID uid=0) const

Return string representation of UID.

CDiagContext & GetDiagContext(void)

Get diag context instance.

CDiagContext_Extra Extra(void) const

Create a temporary CDiagContext_Extra object.

TUID GetUID(void) const

Return (create if not created yet) unique diagnostic ID.

void OnRequestStop(CRequestContext &context) override

static TPID GetPID(void)

Get cached PID (read real PID if not cached yet).

void SetSpanStatus(ESpanStatus status) override

void OnRequestStart(CRequestContext &context) override

jaegertracing::Span & GetSpan(void)

void SetAttribute(ESpanAttribute attr, const string &value) override

shared_ptr< jaegertracing::Span > m_Span

void SetCustomAttribute(const string &attr, const string &value) override

uint64_t Uint8

8-byte (64-bit) unsigned integer

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

static TThreadSystemID GetCurrentThreadSystemID(void)

Get the current thread ID.

void id_hash(const string &s, uint64_t &high, uint64_t &low)

static void s_InitTracer(const string &service_name, const jaegertracing::Config &config)

static jaegertracing::Config s_GetDefaultConfig(void)

Defines CJaegerTracer class for NCBI C++ diagnostic API.

static void hex(unsigned char c)

const GenericPointer< typename T::ValueType > T2 value

String constants used in NCBI C/C++ toolkit.

static CS_CONTEXT * context


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4