afedulov commented on code in PR #950:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/950#discussion_r1987622599
##########
examples/autoscaling/src/main/java/autoscaling/LoadSimulationPipeline.java:
##########
@@ -74,8 +78,37 @@ public static void main(String[] args) throws Exception {
for (String branch : maxLoadPerTask.split("\n")) {
String[] taskLoads = branch.split(";");
+ /*
+ * Creates an unbounded stream that continuously emits the
constant value 42L.
+ * Flink's DataGeneratorSource with RateLimiterStrategy is used to
control the emission rate.
+ *
+ * Emission Rate Logic:
+ * - The goal is to generate a fixed number of impulses per
sampling interval.
+ * - `samplingIntervalMs` defines the duration of one sampling
interval in milliseconds.
+ * - We define `IMPULSES_PER_SAMPLING_INTERVAL = 10`, meaning that
for every sampling interval,
+ * exactly 10 impulses should be generated.
+ *
+ * To calculate the total number of records emitted per second:
+ * 1. Determine how many sampling intervals fit within one second:
+ * samplingIntervalsPerSecond = 1000 / samplingIntervalMs;
+ * 2. Multiply this by the number of impulses per interval to get
the total rate:
+ * impulsesPerSecond = IMPULSES_PER_SAMPLING_INTERVAL *
samplingIntervalsPerSecond;
+ *
+ * Example:
+ * - If `samplingIntervalMs = 500 ms` and
`IMPULSES_PER_SAMPLING_INTERVAL = 10`:
Review Comment:
nit: either introduce this constant and use it in the calculations or use
plain text in the comment.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]