diff --git a/src/domain/notification_factory.rs b/src/domain/notification_factory.rs index db52932..326a26b 100644 --- a/src/domain/notification_factory.rs +++ b/src/domain/notification_factory.rs @@ -36,7 +36,7 @@ impl NotificationFactory { // depth=3 (internal parameter controlling accuracy) // decay=0.5 (decay factor between 0 and 1 for aging out less frequent items; // lower values cause faster forgetting of infrequent items) - let top_followees = TopK::new(100, 500, 3, 0.5); + let top_followees: TopK> = TopK::new(100, 500, 3, 0.5); // Initialize metrics with 0 values for node in top_followees.list() { @@ -141,17 +141,9 @@ impl NotificationFactory { ); info!("Top 100 most followed accounts:"); - // Set all current values to 0 first to handle decreases - for node in self.top_followees.list() { - if let Ok(friendly_id) = String::from_utf8(node.item.to_vec()) { - metrics::top_followee_count(friendly_id.clone()).set(0.0); - } - } - // Then set the actual values for node in self.top_followees.list() { if let Ok(friendly_id) = String::from_utf8(node.item.to_vec()) { metrics::top_followee_count(friendly_id.clone()).set(node.count as f64); - info!(" {}: {} follows", friendly_id, node.count); } } }