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

Function Span2Proto

src/brpc/span.cpp:597–620  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

595}
596
597static void Span2Proto(const Span* span, RpczSpan* out) {
598 out->set_trace_id(span->trace_id());
599 out->set_span_id(span->span_id());
600 out->set_parent_span_id(span->parent_span_id());
601 out->set_log_id(span->log_id());
602 out->set_base_cid(span->base_cid().value);
603 out->set_ending_cid(span->ending_cid().value);
604 out->set_remote_ip(butil::ip2int(span->remote_side().ip));
605 out->set_remote_port(span->remote_side().port);
606 out->set_type(span->type());
607 out->set_async(span->async());
608 out->set_protocol(span->protocol());
609 out->set_request_size(span->request_size());
610 out->set_response_size(span->response_size());
611 out->set_received_real_us(span->received_real_us());
612 out->set_start_parse_real_us(span->start_parse_real_us());
613 out->set_start_callback_real_us(span->start_callback_real_us());
614 out->set_start_send_real_us(span->start_send_real_us());
615 out->set_sent_real_us(span->sent_real_us());
616 out->set_full_method_name(span->full_method_name());
617 // info() returns by value for thread safety (see span.h for details).
618 out->set_info(span->info());
619 out->set_error_code(span->error_code());
620}
621
622inline void ToBigEndian(uint64_t n, uint32_t* buf) {
623 buf[0] = htonl(n >> 32);

Callers 1

IndexMethod · 0.85

Calls 15

ip2intFunction · 0.85
parent_span_idMethod · 0.80
set_base_cidMethod · 0.80
base_cidMethod · 0.80
set_ending_cidMethod · 0.80
ending_cidMethod · 0.80
set_asyncMethod · 0.80
asyncMethod · 0.80
set_protocolMethod · 0.80
protocolMethod · 0.80
set_request_sizeMethod · 0.80
request_sizeMethod · 0.80

Tested by

no test coverage detected