Skip to content

Commit

Permalink
Switch auction length in nexmark to nanos so you don't sample from a …
Browse files Browse the repository at this point in the history
…0 range.
  • Loading branch information
jacksonrnewhouse committed Nov 28, 2023
1 parent fe577d8 commit c1b7287
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions arroyo-worker/src/connectors/nexmark/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand All @@ -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(
Expand Down
8 changes: 4 additions & 4 deletions k8s/arroyo/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit c1b7287

Please sign in to comment.