feat: bind monitors by base url hash
This commit is contained in:
@@ -174,6 +174,31 @@ class Sub2APIQuotaTUITests(unittest.TestCase):
|
||||
self.assertIn("monitors 5 ok / 0 failed / 1 unknown", mod.monitor_summary(status_payload))
|
||||
self.assertIn("monitor operational 2606ms", mod.monitor_detail(row, status_payload))
|
||||
|
||||
def test_monitor_match_prefers_base_url_hash_over_name_tokens(self) -> None:
|
||||
mod = load_module()
|
||||
status_payload = {
|
||||
"channel_monitors": {
|
||||
"items": [
|
||||
{
|
||||
"name": "input responses",
|
||||
"base_url_hash": "wrong-hash",
|
||||
"latest_status": "operational",
|
||||
"latency_ms": 111,
|
||||
},
|
||||
{
|
||||
"name": "unrelated responses",
|
||||
"base_url_hash": "right-hash",
|
||||
"latest_status": "degraded",
|
||||
"latency_ms": 222,
|
||||
},
|
||||
],
|
||||
}
|
||||
}
|
||||
row = {"name": "input 300", "base_url_hash": "right-hash"}
|
||||
|
||||
self.assertEqual(mod.matching_monitor(row, status_payload)["name"], "unrelated responses")
|
||||
self.assertIn("monitor degraded 222ms", mod.monitor_detail(row, status_payload))
|
||||
|
||||
def test_monitor_error_is_non_blocking_in_once_output(self) -> None:
|
||||
mod = load_module()
|
||||
payload = {
|
||||
|
||||
Reference in New Issue
Block a user