Skip to content

Commit

Permalink
fix: Add Kafka
Browse files Browse the repository at this point in the history
  • Loading branch information
bmtcril committed Mar 13, 2024
1 parent e273c4a commit 416a069
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def get_kafka_bus_stats(self):
low, high = consumer.get_watermark_offsets(partition, timeout=10, cached=False)

Check warning on line 185 in platform_plugin_aspects/management/commands/monitor_load_test_tracking.py

View check run for this annotation

Codecov / codecov/patch

platform_plugin_aspects/management/commands/monitor_load_test_tracking.py#L185

Added line #L185 was not covered by tests

if high < 0:
lag = "no hwmark" # Unlikely
lag = 0

Check warning on line 188 in platform_plugin_aspects/management/commands/monitor_load_test_tracking.py

View check run for this annotation

Codecov / codecov/patch

platform_plugin_aspects/management/commands/monitor_load_test_tracking.py#L188

Added line #L188 was not covered by tests
elif partition.offset < 0:
# No committed offset, show total message count as lag.
# The actual message count may be lower due to compaction
Expand All @@ -194,7 +194,7 @@ def get_kafka_bus_stats(self):
else:
lag = high - partition.offset

Check warning on line 195 in platform_plugin_aspects/management/commands/monitor_load_test_tracking.py

View check run for this annotation

Codecov / codecov/patch

platform_plugin_aspects/management/commands/monitor_load_test_tracking.py#L195

Added line #L195 was not covered by tests

print(f"Kafka bus lag: {lag}")
print(f"{partition.topic} [{partition.partition}] Lag: {lag}")

Check warning on line 197 in platform_plugin_aspects/management/commands/monitor_load_test_tracking.py

View check run for this annotation

Codecov / codecov/patch

platform_plugin_aspects/management/commands/monitor_load_test_tracking.py#L197

Added line #L197 was not covered by tests

consumer_stats["partitions"].append({

Check warning on line 199 in platform_plugin_aspects/management/commands/monitor_load_test_tracking.py

View check run for this annotation

Codecov / codecov/patch

platform_plugin_aspects/management/commands/monitor_load_test_tracking.py#L199

Added line #L199 was not covered by tests
"partition": partition.partition,
Expand Down

0 comments on commit 416a069

Please sign in to comment.