Skip to content

Commit

Permalink
TraceAggregator will warn on dropped trace event
Browse files Browse the repository at this point in the history
  • Loading branch information
shuhaowu committed Aug 31, 2023
1 parent 3bd9ef1 commit ca1759b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/cactus_rt/tracing/trace_aggregator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ void TraceAggregator::Run() {

// TODO: major refactor required

uint32_t last_dropped_count = 0;

while (!StopRequested()) {
int tracers_with_events = 0;
{
Expand All @@ -121,6 +123,19 @@ void TraceAggregator::Run() {

tracers_with_events++;
AddTrackEventPacketToTrace(trace, *tracer, event);

auto event_count = tracer->event_count_.Read();
if (event_count.dropped_events - last_dropped_count != 0) {
LOG_WARNING_LIMIT(
std::chrono::milliseconds{1000},
Logger(),
"Thread {} dropped {} trace events, trace for this thread will likely be incorrect",
tracer->name_,
event_count.dropped_events
);

last_dropped_count = event_count.dropped_events;
}
}

if (tracers_with_events > 0) {
Expand Down

0 comments on commit ca1759b

Please sign in to comment.