From c1b7287364b2629b79b193da9a4c4652f8c1370b Mon Sep 17 00:00:00 2001 From: Jackson Newhouse Date: Mon, 27 Nov 2023 18:38:02 -0800 Subject: [PATCH] Switch auction length in nexmark to nanos so you don't sample from a 0 range. --- arroyo-worker/src/connectors/nexmark/mod.rs | 8 ++++---- k8s/arroyo/values.yaml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/arroyo-worker/src/connectors/nexmark/mod.rs b/arroyo-worker/src/connectors/nexmark/mod.rs index 18653c6ac..e14822770 100644 --- a/arroyo-worker/src/connectors/nexmark/mod.rs +++ b/arroyo-worker/src/connectors/nexmark/mod.rs @@ -409,7 +409,7 @@ impl GeneratorConfig { current_size: usize, desired_average_size: usize, ) -> String { - if current_size > desired_average_size { + if true { return String::new(); } let size = desired_average_size - current_size; @@ -438,7 +438,7 @@ impl GeneratorConfig { let category = FIRST_CATEGORY_ID + random.gen_range(0..NUM_CATEGORIES); let initial_bid = Self::next_price(random); let expires = - timestamp + self.next_auction_length_ms(event_counts_so_far, random, timestamp); + timestamp + self.next_auction_length(event_counts_so_far, random, timestamp); let name = Self::random_string(random, 20); let desc = Self::random_string(random, 100); let reserve = initial_bid + Self::next_price(random); @@ -518,7 +518,7 @@ impl GeneratorConfig { (f64::powf(10.0, random.gen_range(0.0..6.0)) * 100.0) as u64 } - fn next_auction_length_ms( + fn next_auction_length( &self, events_counts_so_far: u64, random: &mut SmallRng, @@ -537,7 +537,7 @@ impl GeneratorConfig { // futureAuction - timestamp, numEventsForAuctions); // Choose a length with average horizonMs. let horizon = future_auction.duration_since(timestamp).unwrap(); - Duration::from_millis(1 + u64::max(random.gen_range(0..horizon.as_millis() as u64 * 2), 1)) + Duration::from_nanos(1 + u64::max(random.gen_range(0..(1 + horizon.as_nanos() as u64 * 2)), 1)) } fn next_person( diff --git a/k8s/arroyo/values.yaml b/k8s/arroyo/values.yaml index 972473602..8937d53ac 100644 --- a/k8s/arroyo/values.yaml +++ b/k8s/arroyo/values.yaml @@ -15,7 +15,7 @@ api: image: repository: ghcr.io/arroyosystems/arroyo-services pullPolicy: IfNotPresent - tag: "0.8.0" + tag: "tip" service: type: ClusterIP httpPort: 80 @@ -31,7 +31,7 @@ controller: image: repository: ghcr.io/arroyosystems/arroyo-services pullPolicy: IfNotPresent - tag: "0.8.0" + tag: "tip" service: grpcPort: 9190 adminPort: 9191 @@ -46,7 +46,7 @@ compiler: image: repository: ghcr.io/arroyosystems/arroyo-compiler pullPolicy: IfNotPresent - tag: "0.8.0" + tag: "tip" service: grpcPort: 9000 adminPort: 9001 @@ -61,7 +61,7 @@ worker: image: repository: ghcr.io/arroyosystems/arroyo-worker pullPolicy: IfNotPresent - tag: "0.8.0" + tag: "tip" postgresql: # set to true to deploy a postgres instance in-cluster