@@ -119,15 +119,13 @@ impl TraceAgent {
119119 invocation_processor : Arc < Mutex < InvocationProcessor > > ,
120120 tags_provider : Arc < provider:: Provider > ,
121121 ) -> TraceAgent {
122- // setup a channel to send processed traces to our flusher . tx is passed through each
122+ // Set up a channel to send processed traces to our trace aggregator . tx is passed through each
123123 // endpoint_handler to the trace processor, which uses it to send de-serialized
124- // processed trace payloads to our trace flusher .
124+ // processed trace payloads to our trace aggregator .
125125 let ( trace_tx, mut trace_rx) : ( Sender < SendDataBuilderInfo > , Receiver < SendDataBuilderInfo > ) =
126126 mpsc:: channel ( TRACER_PAYLOAD_CHANNEL_BUFFER_SIZE ) ;
127127
128- // start our trace flusher. receives trace payloads and handles buffering + deciding when to
129- // flush to backend.
130-
128+ // Start the trace aggregator, which receives and buffers trace payloads to be consumed by the trace flusher.
131129 tokio:: spawn ( async move {
132130 while let Some ( tracer_payload_info) = trace_rx. recv ( ) . await {
133131 let mut aggregator = trace_aggregator. lock ( ) . await ;
@@ -151,13 +149,13 @@ impl TraceAgent {
151149 pub async fn start ( & self ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
152150 let now = Instant :: now ( ) ;
153151
154- // channels to send processed stats to our stats flusher .
152+ // Set up a channel to send processed stats to our stats aggregator .
155153 let ( stats_tx, mut stats_rx) : (
156154 Sender < pb:: ClientStatsPayload > ,
157155 Receiver < pb:: ClientStatsPayload > ,
158156 ) = mpsc:: channel ( STATS_PAYLOAD_CHANNEL_BUFFER_SIZE ) ;
159157
160- // Receive stats payload and send it to the aggregator
158+ // Start the stats aggregator, which receives and buffers stats payloads to be consumed by the stats flusher.
161159 let stats_aggregator = self . stats_aggregator . clone ( ) ;
162160 tokio:: spawn ( async move {
163161 while let Some ( stats_payload) = stats_rx. recv ( ) . await {
@@ -500,12 +498,12 @@ impl TraceAgent {
500498 )
501499 . await ;
502500
503- // send trace payload to our trace flusher
501+ // send trace payload to our trace aggregator
504502 match trace_tx. send ( send_data) . await {
505- Ok ( ( ) ) => success_response ( "Successfully buffered traces to be flushed ." ) ,
503+ Ok ( ( ) ) => success_response ( "Successfully buffered traces to be aggregated ." ) ,
506504 Err ( err) => error_response (
507505 StatusCode :: INTERNAL_SERVER_ERROR ,
508- format ! ( "Error sending traces to the trace flusher : {err}" ) ,
506+ format ! ( "Error sending traces to the trace aggregator : {err}" ) ,
509507 ) ,
510508 }
511509 }
0 commit comments