Skip to content

Commit

Permalink
fixup! In KafkaConsumer class, implement throttling of telemetry data.
Browse files Browse the repository at this point in the history
  • Loading branch information
tribeiro committed Feb 14, 2025
1 parent b9e92c2 commit 5a4d74e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/lsst/ts/salobj/kafka_consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,16 +478,16 @@ def _handle_throttle(self) -> None:
self.max_throttle,
]
)
self.log.info(
f"{kafka_name}: {index=} throutput={n_read/dt} messages/s ({throttle=})."
)
old_throttle = self.throttle_telemetry[kafka_name].get(
index, throttle
)
if throttle > old_throttle + self.max_throttle_change:
throttle = old_throttle + self.max_throttle_change
elif throttle < old_throttle - self.max_throttle_change:
throttle = old_throttle - self.max_throttle_change
self.log.info(
f"{kafka_name}: {index=} throutput={n_read/dt} messages/s ({throttle=})."
)
self.throttle_telemetry[kafka_name][index] = throttle
self.telemetry_n_reads[kafka_name][index] = 1
self.throutput_measurement_n_reads = 0
Expand Down

0 comments on commit 5a4d74e

Please sign in to comment.