MCPcopy Create free account
hub / github.com/apache/brpc / GenerateSpanId

Function GenerateSpanId

src/brpc/span.cpp:170–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

168}
169
170inline uint64_t GenerateSpanId() {
171 // 0 is an invalid Id
172 IdGen* g = &tls_span_id_gen;
173 if (g->seq == 0) {
174 UpdateTLSRandom64(g);
175 g->seq = 1;
176 }
177 return (g->current_random & 0xFFFFFFFFFFFF0000ULL) | g->seq++;
178}
179
180inline uint64_t GenerateTraceId() {
181 // 0 is an invalid Id

Callers 3

CreateClientSpanMethod · 0.85
CreateBthreadSpanMethod · 0.85
CreateServerSpanMethod · 0.85

Calls 1

UpdateTLSRandom64Function · 0.85

Tested by

no test coverage detected