| 595 | } |
| 596 | |
| 597 | static 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 | |
| 622 | inline void ToBigEndian(uint64_t n, uint32_t* buf) { |
| 623 | buf[0] = htonl(n >> 32); |
no test coverage detected