Skip to content

Commit

Permalink
fix(ci): fix executor metrics in release mode (#3087)
Browse files Browse the repository at this point in the history
Fix executor metrics in release mode
  • Loading branch information
MingjiHan99 authored Jun 9, 2022
1 parent aae3f9c commit 77e07f0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/stream/src/executor/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ impl DebugExecutor {
stream: impl MessageStream + 'static,
) -> impl MessageStream + 'static {
// Metrics
let stream = trace::metrics(extra.actor_id, extra.metrics, stream);
let stream = trace::metrics(extra.actor_id, extra.executor_id, extra.metrics, stream);

// Epoch check
let stream = epoch_check::epoch_check(info, stream);
Expand Down
11 changes: 8 additions & 3 deletions src/stream/src/executor/debug/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,22 @@ pub async fn trace(

/// Streams wrapped by `metrics` will update actor metrics.
#[try_stream(ok = Message, error = StreamExecutorError)]
pub async fn metrics(actor_id: ActorId, metrics: Arc<StreamingMetrics>, input: impl MessageStream) {
pub async fn metrics(
actor_id: ActorId,
executor_id: u64,
metrics: Arc<StreamingMetrics>,
input: impl MessageStream,
) {
let actor_id_string = actor_id.to_string();

let executor_id_string = executor_id.to_string();
pin_mut!(input);

while let Some(message) = input.next().await.transpose()? {
if let Message::Chunk(chunk) = &message {
if chunk.cardinality() > 0 {
metrics
.executor_row_count
.with_label_values(&[&actor_id_string])
.with_label_values(&[&actor_id_string, &executor_id_string])
.inc_by(chunk.cardinality() as u64);
}
}
Expand Down

0 comments on commit 77e07f0

Please sign in to comment.