Skip to content

Commit

Permalink
style: Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
bmtcril committed Mar 20, 2024
1 parent d890bfd commit ff7486c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class Monitor:
"""
Manages the configuration and state of the load test monitor.
"""

def __init__(self, sleep_time: float, backend: str):
self.run_id = str(uuid.uuid4())[:6]
self.ch_url = settings.EVENT_SINK_CLICKHOUSE_BACKEND_CONFIG["url"]
Expand Down
38 changes: 22 additions & 16 deletions platform_plugin_aspects/tests/commands/test_load_test_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def load_test_command_basic_options():
expected_logs=[
"Clickhouse lag seconds: 1",
"Starting monitor for kafka_bus with sleep of 10 seconds",
"test [test] Lag: 95"
"test [test] Lag: 95",
],
),
# Test vector backend
Expand Down Expand Up @@ -113,18 +113,24 @@ def test_monitor_options(test_command_option, caplog):
]
},
# Second response is the Vector API call, GraphQL is awful.
{"data": {
"sinks": {
"edges": [{
"node": {
"metrics": {
"sentEventsTotal": {"sentEventsTotal": 10},
"receivedEventsTotal": {"receivedEventsTotal": 10},
},
},
}],
{
"data": {
"sinks": {
"edges": [
{
"node": {
"metrics": {
"sentEventsTotal": {"sentEventsTotal": 10},
"receivedEventsTotal": {
"receivedEventsTotal": 10
},
},
},
}
],
}
}
}},
},
)

patches["redis"].Redis.from_url.return_value.llen.return_value = 5
Expand All @@ -133,16 +139,16 @@ def test_monitor_options(test_command_option, caplog):
"groups": [
{"name": "group1", "lag": 2},
{"name": "group2", "lag": 3},
]
],
}

patches["confluent_kafka"].Consumer.return_value.committed.return_value = {
KafkaPartition(offset=5, topic="test", partition="test"): Mock()
}

patches["confluent_kafka"].Consumer.return_value.get_watermark_offsets.return_value = (
10, 100
)
patches[
"confluent_kafka"
].Consumer.return_value.get_watermark_offsets.return_value = (10, 100)

call_command("monitor_load_test_tracking", **option_combination)

Expand Down

0 comments on commit ff7486c

Please sign in to comment.