Skip to content

Commit fabd090

Browse files
Addressed comment
1 parent de713b7 commit fabd090

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

examples/autoscaling/src/main/java/autoscaling/LoadSimulationPipeline.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff 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");

0 commit comments

Comments
 (0)