From 7cc4b1701aa2923573adabceed486229abba5a2d Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Fri, 20 Mar 2026 13:44:00 +0100 Subject: add hub instance info (#869) - Improvement: Hub module listing now includes per-instance process metrics (memory, CPU time, working set, pagefile usage) - Improvement: Hub now monitors provisioned instance health in the background and refreshes process metrics periodically - Improvement: Hub no longer exposes raw `StorageServerInstance` pointers to callers; instance state is returned as value snapshots (`Hub::InstanceInfo`) - Improvement: Hub instance access is now guarded by RAII per-instance locks (`SharedLockedPtr`/`ExclusiveLockedPtr`), preventing concurrent modifications during provisioning and deprovisioning - Improvement: Hub instance lifecycle is now tracked as a `HubInstanceState` enum covering transitional states (Provisioning, Deprovisioning, Hibernating, Waking); exposed as a string in the HTTP API and dashboard --- src/zenserver-test/hub-tests.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/zenserver-test/hub-tests.cpp') diff --git a/src/zenserver-test/hub-tests.cpp b/src/zenserver-test/hub-tests.cpp index 29c3b76ba..a372b11e5 100644 --- a/src/zenserver-test/hub-tests.cpp +++ b/src/zenserver-test/hub-tests.cpp @@ -44,7 +44,8 @@ TEST_CASE("hub.lifecycle.basic") HttpClient Client(Instance.GetBaseUri() + "/hub/"); HttpClient::Response Result = Client.Get("status"); - CHECK(Result); + REQUIRE(Result); + CHECK_EQ(Result.AsObject()["modules"].AsArrayView().Num(), 0u); } } @@ -71,6 +72,10 @@ TEST_CASE("hub.lifecycle.children") const uint16_t AbcPort = AbcResult["port"].AsUInt16(0); CHECK_NE(AbcPort, 0); + Result = Client.Get("modules/abc"); + REQUIRE(Result); + CHECK_EQ(Result.AsObject()["state"].AsString(), "provisioned"sv); + // This should be a fresh instance with no contents HttpClient AbcClient(fmt::format("http://localhost:{}", AbcPort)); @@ -231,9 +236,10 @@ TEST_CASE("hub.lifecycle.children") Result = Client.Post("modules/def/deprovision"); REQUIRE(Result); - // final sanity check that the hub is still responsive + // final sanity check that the hub is still responsive and all modules are gone Result = Client.Get("status"); - CHECK(Result); + REQUIRE(Result); + CHECK_EQ(Result.AsObject()["modules"].AsArrayView().Num(), 0u); } } -- cgit v1.2.3