Skip to content

Commit

Permalink
some metrics for batch embed
Browse files Browse the repository at this point in the history
  • Loading branch information
magdyksaleh committed Dec 11, 2024
1 parent ea6a62a commit 7eb9f72
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions router/src/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ impl AdapterSchedulerState {
};

let num_entries = self.queues_state.lock().await.len();
metrics::gauge!("lorax_queue_length", num_entries as f64);
if num_entries == 0 {
return None;
}
Expand Down
4 changes: 4 additions & 0 deletions router/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1774,6 +1774,8 @@ async fn classify(
inference_time.as_secs_f64()
);

tracing::info!("Success");

Ok((headers, Json(response.predictions)))
}

Expand Down Expand Up @@ -1858,6 +1860,8 @@ async fn classify_batch(
);

let batch_entity_vec = responses.into_iter().map(|r| r.predictions).collect();
tracing::debug!("Output: {:?}", batch_entity_vec);
tracing::info!("Success");
Ok((headers, Json(batch_entity_vec)))
}

Expand Down

0 comments on commit 7eb9f72

Please sign in to comment.