You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by GitBox <gi...@apache.org> on 2020/01/03 03:07:11 UTC

[GitHub] [incubator-brpc] jamesge commented on a change in pull request #537: customise span exporter

jamesge commented on a change in pull request #537: customise span exporter
URL: https://github.com/apache/incubator-brpc/pull/537#discussion_r362695096
 
 

 ##########
 File path: src/brpc/span.cpp
 ##########
 @@ -199,47 +199,42 @@ void Span::destroy() {
     Span* p = _next_client;
     while (p) {
         Span* p_next = p->_next_client;
-        p->_info.clear();
+        p->_annotation_list.clear();
         butil::return_object(p);
         p = p_next;
     }
-    _info.clear();
+    _annotation_list.clear();
     butil::return_object(this);
 }
 
 void Span::Annotate(const char* fmt, ...) {
-    const int64_t anno_time = butil::cpuwide_time_us() + _base_real_us;
-    butil::string_appendf(&_info, BRPC_SPAN_INFO_SEP "%lld ",
-                         (long long)anno_time);
     va_list ap;
     va_start(ap, fmt);
-    butil::string_vappendf(&_info, fmt, ap);
+    Annotate(fmt, ap);
     va_end(ap);
 }
 
 void Span::Annotate(const char* fmt, va_list args) {
     const int64_t anno_time = butil::cpuwide_time_us() + _base_real_us;
-    butil::string_appendf(&_info, BRPC_SPAN_INFO_SEP "%lld ",
-                         (long long)anno_time);
-    butil::string_vappendf(&_info, fmt, args);
+    std::string anno_content;
+    butil::string_vappendf(&anno_content, fmt, args);
 
 Review comment:
   string_printf就行了

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org