Skip to content

Commit

Permalink
nexmark:make inter_event_delay nanos grain. (#450)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksonrnewhouse committed Dec 13, 2023
1 parent 7f1baf1 commit 2e513f0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arroyo-worker/src/connectors/nexmark/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,8 @@ impl GeneratorConfig {
total_proportion: nexmark_config.person_proportion
+ nexmark_config.auction_proportion
+ nexmark_config.bid_proportion,
inter_event_delay: Duration::from_micros(
(1000000.0 / (nexmark_config.first_event_rate)
inter_event_delay: Duration::from_nanos(
(1_000_000_000.0 / (nexmark_config.first_event_rate)
* (nexmark_config.num_event_generators as f64)) as u64,
),
_step_length_second: (nexmark_config.rate_period_seconds + 2 - 1) / 2,
Expand Down Expand Up @@ -510,7 +510,7 @@ impl GeneratorConfig {

fn timestamp_for_event(&self, event_number: u64) -> SystemTime {
self.base_time
+ Duration::from_micros(self.inter_event_delay.as_micros() as u64 * event_number)
+ Duration::from_nanos(self.inter_event_delay.as_nanos() as u64 * event_number)
}

fn next_price(random: &mut SmallRng) -> u64 {
Expand Down

0 comments on commit 2e513f0

Please sign in to comment.