| 416 | } |
| 417 | |
| 418 | bool SpanInfoExtractor::PopAnnotation( |
| 419 | int64_t before_this_time, int64_t* time, std::string* annotation) { |
| 420 | for (; _sp != NULL; ++_sp) { |
| 421 | butil::StringSplitter sp_time(_sp.field(), _sp.field() + _sp.length(), ' '); |
| 422 | if (sp_time) { |
| 423 | char* endptr; |
| 424 | const int64_t anno_time = strtoll(sp_time.field(), &endptr, 10); |
| 425 | if (*endptr == ' ') { |
| 426 | if (before_this_time <= anno_time) { |
| 427 | return false; |
| 428 | } |
| 429 | *time = anno_time; |
| 430 | ++sp_time; |
| 431 | annotation->assign( |
| 432 | sp_time.field(), |
| 433 | _sp.field() + _sp.length() - sp_time.field()); |
| 434 | ++_sp; |
| 435 | return true; |
| 436 | } |
| 437 | } |
| 438 | LOG(ERROR) << "Unknown annotation: " |
| 439 | << std::string(_sp.field(), _sp.length()); |
| 440 | } |
| 441 | return false; |
| 442 | } |
| 443 | |
| 444 | bool CanAnnotateSpan() { |
| 445 | return HasTlsParentSpan(); |
no test coverage detected