File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
examples/autoscaling/src/main/java/autoscaling Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,11 @@ public class LoadSimulationPipeline {
6464
6565 private static final Logger LOG = LoggerFactory .getLogger (LoadSimulationPipeline .class );
6666
67+ // Number of impulses (records) emitted per sampling interval.
68+ // This value determines how many records should be generated within each `samplingIntervalMs`
69+ // period.
70+ private static final int IMPULSES_PER_SAMPLING_INTERVAL = 10 ;
71+
6772 public static void main (String [] args ) throws Exception {
6873 var env = StreamExecutionEnvironment .getExecutionEnvironment ();
6974 env .disableOperatorChaining ();
@@ -105,7 +110,9 @@ public static void main(String[] args) throws Exception {
105110 (index ) -> 42L , // Emits constant value 42
106111 Long .MAX_VALUE , // Unbounded stream
107112 RateLimiterStrategy .perSecond (
108- (1000.0 / samplingIntervalMs ) * 10 ), // Controls rate
113+ (1000.0 / samplingIntervalMs )
114+ * IMPULSES_PER_SAMPLING_INTERVAL ), // Controls
115+ // rate
109116 Types .LONG ),
110117 WatermarkStrategy .noWatermarks (),
111118 "ImpulseSource" );
You can’t perform that action at this time.
0 commit comments