feat(orchestrator): time range and replay move into the rates panel (015)
The navbar time menu goes; the rates panel holds the presets, a two-handle span slider over the hub's history, replay and Live, and the custom From/To range. A custom range becomes a window length plus an end point, so live windows keep their length. The rates chip lists every metric, and the panel wraps instead of spilling at 390 px. Unit and e2e (Chromium, Firefox, 1920/1366/390) cover the window, the slider and the requests. 🎯 Fix: 94 % 💥 Break: 4 % 💸 Tokens: 100 % ⏱️ Velocity: 100 % 🛡️ Security: 100 % 🏆 Score: 90 🚦 Gate: ✅ 90/5, tokens and velocity <= 100, security 100 % Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
09e3f6dabe
commit
cc6ea7c230
20 files changed
+462
-416
No files matched your search
@@ -5,7 +5,7 @@ import unittest
|
||||
|
||||
from hub_case import HubCase
|
||||
from hub_support import STREAMS, Key, key
|
||||
from kvb_orchestrator import settings
|
||||
from kvb_orchestrator import rates, settings
|
||||
|
||||
|
||||
class TestHubSettings(HubCase):
|
||||
@@ -199,13 +199,13 @@ class TestHubSettings(HubCase):
|
||||
self.assertEqual((settings.SETTINGS["rates"], self.snapshot()["settings"]["rates"]), (default, default))
|
||||
good = self.guard(self.host)
|
||||
wrongs = [{"period": period, "metrics": ["tasks", "cpu"]} for period in ("second", "Hour", "", None, 1)]
|
||||
wrongs += [{"period": "day", "metrics": metrics} for metrics in (["tasks"], [], ["tasks", "cpu", "ram", "swap"], ["tasks", "tasks"], ["tasks", "gpu"], [1, 2], "tasks,cpu", None)]
|
||||
wrongs += [{"period": "day", "metrics": metrics} for metrics in (["tasks"], [], [*rates.METRICS, "tasks"], ["tasks", "tasks"], ["tasks", "gpu"], [1, 2], "tasks,cpu", None)]
|
||||
wrongs += [{"period": "day"}, {"metrics": ["tasks", "cpu"]}, {**default, "extra": 1}, "day", ["day"]]
|
||||
for wrong in wrongs:
|
||||
with self.subTest(wrong=wrong):
|
||||
self.assertEqual(self.post_json("/api/settings", {**settings.SETTINGS, "rates": wrong}, good)[0], 400)
|
||||
self.assertEqual(self.snapshot()["settings"]["rates"], default)
|
||||
for chosen in ({"period": "minute", "metrics": ["commits", "krs"]}, {"period": "total", "metrics": ["disk", "vram", "swap"]}, {"period": "week", "metrics": ["ram", "tokens"]}):
|
||||
for chosen in ({"period": "minute", "metrics": ["commits", "krs"]}, {"period": "total", "metrics": list(reversed(rates.METRICS))}, {"period": "week", "metrics": ["ram", "tokens"]}):
|
||||
with self.subTest(chosen=chosen):
|
||||
self.assertIsNone(self.prepared({**self.snapshot()["settings"], "rates": chosen})["payload"])
|
||||
status, _, body = self.post_json("/api/settings", {**self.snapshot()["settings"], "rates": chosen, "proof": None}, good)
|
||||
|
||||
Reference in new issue
Block a user