From 814203139d0952f77db92af68883723ff9030558 Mon Sep 17 00:00:00 2001 From: Lucas Kent Date: Fri, 9 Feb 2024 07:47:46 +1100 Subject: [PATCH] windsock: Fix cloud metrics for kafka+redis (#1461) Co-authored-by: Conor --- shotover-proxy/benches/windsock/kafka/bench.rs | 11 ++++++++++- shotover-proxy/benches/windsock/redis/bench.rs | 15 +++++++++++---- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/shotover-proxy/benches/windsock/kafka/bench.rs b/shotover-proxy/benches/windsock/kafka/bench.rs index 741194fe7..003035fd5 100644 --- a/shotover-proxy/benches/windsock/kafka/bench.rs +++ b/shotover-proxy/benches/windsock/kafka/bench.rs @@ -287,12 +287,21 @@ impl Bench for KafkaBench { let shotover_ip = shotover_instance .as_ref() .map(|x| x.instance.private_ip().to_string()); + let shotover_connect_ip = match self.topology { + KafkaTopology::Single => kafka_instances + .first() + .as_ref() + .map(|x| x.instance.connect_ip().to_string()), + KafkaTopology::Cluster1 | KafkaTopology::Cluster3 => shotover_instance + .as_ref() + .map(|x| x.instance.connect_ip().to_string()), + }; let mut profiler = CloudProfilerRunner::new( self.name(), profiling, profiler_instances, - &Some(kafka_ip.clone()), + &shotover_connect_ip, ) .await; diff --git a/shotover-proxy/benches/windsock/redis/bench.rs b/shotover-proxy/benches/windsock/redis/bench.rs index bc162f382..1e201ed38 100644 --- a/shotover-proxy/benches/windsock/redis/bench.rs +++ b/shotover-proxy/benches/windsock/redis/bench.rs @@ -251,10 +251,17 @@ impl Bench for RedisBench { let shotover_ip = shotover_instance .as_ref() .map(|x| x.instance.private_ip().to_string()); - - let mut profiler = - CloudProfilerRunner::new(self.name(), profiling, profiler_instances, &shotover_ip) - .await; + let shotover_connect_ip = shotover_instance + .as_ref() + .map(|x| x.instance.connect_ip().to_string()); + + let mut profiler = CloudProfilerRunner::new( + self.name(), + profiling, + profiler_instances, + &shotover_connect_ip, + ) + .await; let (_, running_shotover) = futures::join!( redis_instances.run(self.encryption),