Skip to content

Commit

Permalink
[forge][chaos] expand to six regions
Browse files Browse the repository at this point in the history
  • Loading branch information
ibalajiarun committed Oct 3, 2024
1 parent 6140801 commit a28c7bf
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 3 deletions.
10 changes: 9 additions & 1 deletion testsuite/testcases/src/data/four_region_link_stats.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,20 @@ sending_region,receiving_region,bitrate_bps,avgrtt
gcp--us-central1,aws--eu-west-1,300000000,103.435
gcp--us-central1,aws--ap-northeast-1,300000000,133.996
gcp--us-central1,aws--sa-east-1,300000000,145.483
gcp--us-central1,gcp--as-southeast-1,300000000,195.763
aws--sa-east-1,gcp--us-central1,300000000,145.703
aws--sa-east-1,aws--eu-west-1,300000000,176.894
aws--sa-east-1,aws--ap-northeast-1,300000000,255.289
aws--sa-east-1,gcp--as-southeast-1,300000000,329.213
aws--eu-west-1,gcp--us-central1,300000000,104.169
aws--eu-west-1,aws--sa-east-1,300000000,176.813
aws--eu-west-1,aws--ap-northeast-1,300000000,198.555
aws--eu-west-1,gcp--as-southeast-1,300000000,211.419
aws--ap-northeast-1,gcp--us-central1,300000000,128.999
aws--ap-northeast-1,aws--eu-west-1,300000000,198.539
aws--ap-northeast-1,aws--sa-east-1,300000000,255.323
aws--ap-northeast-1,aws--sa-east-1,300000000,255.323
aws--ap-northeast-1,gcp--as-southeast-1,300000000,72.837
gcp--as-southeast-1,gcp--us-central1,300000000,195.763
gcp--as-southeast-1,aws--sa-east-1,300000000,329.213
gcp--as-southeast-1,aws--eu-west-1,300000000,211.419
gcp--as-southeast-1,aws--ap-northeast-1,300000000,72.837
31 changes: 31 additions & 0 deletions testsuite/testcases/src/data/six_region_link_stats.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
sending_region,receiving_region,bitrate_bps,avgrtt
gcp--us-central1,aws--eu-west-1,300000000,103.435
gcp--us-central1,aws--ap-northeast-1,300000000,133.996
gcp--us-central1,aws--sa-east-1,300000000,145.483
gcp--us-central1,gcp--as-southeast-1,300000000,195.763
gcp--us-central1,gcp--australia-southeast1,300000000,175.426
aws--sa-east-1,gcp--us-central1,300000000,145.703
aws--sa-east-1,aws--eu-west-1,300000000,176.894
aws--sa-east-1,aws--ap-northeast-1,300000000,255.289
aws--sa-east-1,gcp--as-southeast-1,300000000,329.213
aws--sa-east-1,gcp--australia-southeast1,300000000,305.157
aws--eu-west-1,gcp--us-central1,300000000,104.169
aws--eu-west-1,aws--sa-east-1,300000000,176.813
aws--eu-west-1,aws--ap-northeast-1,300000000,198.555
aws--eu-west-1,gcp--as-southeast-1,300000000,211.419
aws--eu-west-1,gcp--australia-southeast1,300000000,271.738
aws--ap-northeast-1,gcp--us-central1,300000000,128.999
aws--ap-northeast-1,aws--eu-west-1,300000000,198.539
aws--ap-northeast-1,aws--sa-east-1,300000000,255.323
aws--ap-northeast-1,gcp--as-southeast-1,300000000,72.837
aws--ap-northeast-1,gcp--australia-southeast1,300000000,144.842
gcp--as-southeast-1,gcp--us-central1,300000000,195.763
gcp--as-southeast-1,aws--sa-east-1,300000000,329.213
gcp--as-southeast-1,aws--eu-west-1,300000000,211.419
gcp--as-southeast-1,aws--ap-northeast-1,300000000,72.837
gcp--as-southeast-1,gcp--australia-southeast1,300000000,94.512
gcp--australia-southeast1,gcp--us-central1,300000000,175.426
gcp--australia-southeast1,aws--sa-east-1,300000000,305.157
gcp--australia-southeast1,aws--eu-west-1,300000000,271.738
gcp--australia-southeast1,aws--ap-northeast-1,300000000,144.842
gcp--australia-southeast1,gcp--as-southeast-1,300000000,94.512
19 changes: 17 additions & 2 deletions testsuite/testcases/src/multi_region_network_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use std::{collections::BTreeMap, sync::Arc};
/// is measuring TCP bandwidth only which is primarily affected by RTT, and not the actual bandwidth
/// across the regions, which would vary according to competing traffic, etc.
const FOUR_REGION_LINK_STATS: &[u8] = include_bytes!("data/four_region_link_stats.csv");
const SIX_REGION_LINK_STATS: &[u8] = include_bytes!("data/six_region_link_stats.csv");
/// The two regions were chosen as the most distant regions among the four regions set.
const TWO_REGION_LINK_STATS: &[u8] = include_bytes!("data/two_region_link_stats.csv");

Expand Down Expand Up @@ -79,7 +80,7 @@ fn create_link_stats_table_with_peer_groups(
"At least 2 regions are required for inter-region network chaos."
);
assert!(
number_of_regions <= 4,
number_of_regions <= 6,
"ChaosMesh only supports simulating up to 4 regions."
);

Expand Down Expand Up @@ -223,7 +224,7 @@ pub struct MultiRegionNetworkEmulationConfig {
impl Default for MultiRegionNetworkEmulationConfig {
fn default() -> Self {
Self {
link_stats_table: get_link_stats_table(FOUR_REGION_LINK_STATS),
link_stats_table: get_link_stats_table(SIX_REGION_LINK_STATS),
inter_region_config: InterRegionNetEmConfig::default(),
intra_region_config: Some(IntraRegionNetEmConfig::default()),
}
Expand All @@ -237,6 +238,20 @@ impl MultiRegionNetworkEmulationConfig {
..Default::default()
}
}

pub fn four_region() -> Self {
Self {
link_stats_table: get_link_stats_table(FOUR_REGION_LINK_STATS),
..Default::default()
}
}

pub fn six_region() -> Self {
Self {
link_stats_table: get_link_stats_table(SIX_REGION_LINK_STATS),
..Default::default()
}
}
}

/// A test to emulate network conditions for a multi-region setup.
Expand Down

0 comments on commit a28c7bf

Please sign in to comment.