hunter/worker: log with stats_key to differentiate "stream_token"

This commit is contained in:
Astro 2023-10-30 00:36:01 +01:00
parent 57da2139c1
commit d23bb61cb6
1 changed files with 2 additions and 2 deletions

View File

@ -128,14 +128,14 @@ pub async fn run(
// Process stream
let (mut new_post_ratio, mut mean_interval) = timeline_result.unwrap_or((None, None));
if let Ok((stats_key, stream)) = stream_result {
tracing::info!("Processing stream for {}", &host.host);
tracing::info!("Processing {stats_key} for {}", &host.host);
metrics::increment_gauge!("hunter_requests", 1.0, "type" => stats_key);
let start_time = Instant::now();
let post_count = stream.await;
let end_time = Instant::now();
metrics::decrement_gauge!("hunter_requests", 1.0, "type" => stats_key);
tracing::warn!("Ended stream for {}. {} posts in {:?}", &host.host, post_count, end_time - start_time);
tracing::warn!("Ended {stats_key} for {}. {} posts in {:?}", &host.host, post_count, end_time - start_time);
if post_count > 0 {
if let Some(ref mut new_post_ratio) = new_post_ratio {