Skip to content

Commit

Permalink
Visualize pipeline items in the various stages as trace flows. (flutt…
Browse files Browse the repository at this point in the history
  • Loading branch information
chinmaygarde authored Jul 19, 2017
1 parent 488584f commit a09436a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions synchronization/pipeline.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ class Pipeline : public ftl::RefCountedThreadSafe<Pipeline<R>> {
if (continuation_) {
continuation_(nullptr, trace_id_);
TRACE_EVENT_ASYNC_END0("flutter", "PipelineProduce", trace_id_);
// The continuation is being dropped on the floor. End the flow.
TRACE_FLOW_END("flutter", "PipelineItem", trace_id_);
}
}

Expand All @@ -60,6 +62,7 @@ class Pipeline : public ftl::RefCountedThreadSafe<Pipeline<R>> {
continuation_(std::move(resource), trace_id_);
continuation_ = nullptr;
TRACE_EVENT_ASYNC_END0("flutter", "PipelineProduce", trace_id_);
TRACE_FLOW_STEP("flutter", "PipelineItem", trace_id_);
}
}

Expand All @@ -74,6 +77,7 @@ class Pipeline : public ftl::RefCountedThreadSafe<Pipeline<R>> {

ProducerContinuation(Continuation continuation, size_t trace_id)
: continuation_(continuation), trace_id_(trace_id) {
TRACE_FLOW_BEGIN("flutter", "PipelineItem", trace_id_);
TRACE_EVENT_ASYNC_BEGIN0("flutter", "PipelineProduce", trace_id_);
}

Expand Down Expand Up @@ -128,6 +132,8 @@ class Pipeline : public ftl::RefCountedThreadSafe<Pipeline<R>> {

empty_.Signal();

TRACE_FLOW_END("flutter", "PipelineItem", trace_id);

return items_count > 0 ? PipelineConsumeResult::MoreAvailable
: PipelineConsumeResult::Done;
}
Expand Down

0 comments on commit a09436a

Please sign in to comment.