Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion agents/src/span_collector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ void SpanCollector::do_collect() {
// Only notify the loop_ thread if the queue reaches min_span_count_to
// avoid too many uv_async_t::send() calls.
if (collector->span_msg_q_.enqueue(span) > collector->min_span_count_) {
ASSERT_EQ(0, collector->span_msg_->send());
if (!collector->sent_) {
ASSERT_EQ(0, collector->span_msg_->send());
collector->sent_ = true;
}
} else if (collector->sent_) {
collector->sent_ = false;
}
},
weak_from_this());
Expand Down
1 change: 1 addition & 0 deletions agents/src/span_collector.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class SpanCollector: public std::enable_shared_from_this<SpanCollector> {
nsuv::ns_timer* span_timer_;
std::function<void(const SpanVector&)> callback_ = nullptr;
std::function<void(const SpanVector&)> transform_callback_ = nullptr;
bool sent_ = false;
};

} // namespace nsolid
Expand Down
Loading