Skip to content

Commit

Permalink
KafkaSinkCluster benches
Browse files Browse the repository at this point in the history
  • Loading branch information
rukai committed Nov 28, 2023
1 parent f4fde8a commit 4764d7a
Show file tree
Hide file tree
Showing 4 changed files with 215 additions and 71 deletions.
18 changes: 3 additions & 15 deletions shotover-proxy/benches/windsock/cassandra.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{
aws::{Ec2InstanceWithDocker, Ec2InstanceWithShotover, RunningShotover},
common::{self, Shotover},
common::{self, Shotover, Topology},
profilers::{self, CloudProfilerRunner, ProfilerRunner},
};
use anyhow::Result;
Expand Down Expand Up @@ -74,12 +74,6 @@ enum CassandraDbInstance {
Mocked(MockHandle),
}

#[derive(Clone, PartialEq)]
pub enum Topology {
Single,
Cluster3,
}

struct CoreCount {
/// Cores to be assigned to the bench's tokio runtime
bench: usize,
Expand Down Expand Up @@ -455,13 +449,7 @@ impl Bench for CassandraBench {
CassandraDb::Mocked => "cassandra-mocked".to_owned(),
},
),
(
"topology".to_owned(),
match &self.topology {
Topology::Single => "single".to_owned(),
Topology::Cluster3 => "cluster3".to_owned(),
},
),
self.topology.to_tag(),
self.shotover.to_tag(),
(
"operation".to_owned(),
Expand Down Expand Up @@ -564,7 +552,7 @@ impl Bench for CassandraBench {
];

let (_, running_shotover) = futures::join!(
run_aws_cassandra(cassandra_nodes, self.topology.clone()),
run_aws_cassandra(cassandra_nodes, self.topology),
self.run_aws_shotover(shotover_instance.clone(), cassandra_ip.clone(),)
);

Expand Down
22 changes: 20 additions & 2 deletions shotover-proxy/benches/windsock/common.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use shotover::{config::topology::Topology, sources::SourceConfig};
use shotover::{config::topology::Topology as ShotoverTopology, sources::SourceConfig};

#[derive(Clone, Copy)]
pub enum Shotover {
Expand All @@ -20,8 +20,26 @@ impl Shotover {
}
}

#[derive(Clone, Copy, PartialEq)]
pub enum Topology {
Single,
Cluster3,
}

impl Topology {
pub fn to_tag(self) -> (String, String) {
(
"topology".to_owned(),
match self {
Topology::Single => "single".to_owned(),
Topology::Cluster3 => "cluster3".to_owned(),
},
)
}
}

pub fn generate_topology(source: SourceConfig) -> String {
Topology {
ShotoverTopology {
sources: vec![source],
}
.serialize()
Expand Down
Loading

0 comments on commit 4764d7a

Please sign in to comment.