This is an automated email from the ASF dual-hosted git repository.
janhoy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr-orbit.git
The following commit(s) were added to refs/heads/main by this push:
new 366c7b52 Create ClusterEnvironmentInfo so --telemetry
cluster-environment-info works (#135)
366c7b52 is described below
commit 366c7b52043a78e9f6e8f38766d03971a26360d8
Author: Syed Ahnaf Raza <[email protected]>
AuthorDate: Tue Oct 20 13:31:52 2026 +0500
Create ClusterEnvironmentInfo so --telemetry cluster-environment-info works
(#135)
The device is listed by 'solr-orbit list telemetry' and documented, but
_create_solr_telemetry_devices never built it, so enabling it did nothing.
Fixes #134
---
solrorbit/worker_coordinator/worker_coordinator.py | 1 +
tests/worker_coordinator/worker_coordinator_test.py | 15 +++++++++++++++
2 files changed, 16 insertions(+)
diff --git a/solrorbit/worker_coordinator/worker_coordinator.py
b/solrorbit/worker_coordinator/worker_coordinator.py
index 8db170fe..9bc5f412 100644
--- a/solrorbit/worker_coordinator/worker_coordinator.py
+++ b/solrorbit/worker_coordinator/worker_coordinator.py
@@ -938,6 +938,7 @@ class WorkerCoordinator:
telemetry.SolrCacheStats(sc, self.metrics_store),
telemetry.SegmentStats(log_root, sc),
telemetry.ShardStats(telemetry_params, sc, self.metrics_store),
+ telemetry.ClusterEnvironmentInfo(sc, self.metrics_store),
]
def wait_for_rest_api(self, clients):
diff --git a/tests/worker_coordinator/worker_coordinator_test.py
b/tests/worker_coordinator/worker_coordinator_test.py
index 2ee7a4b8..0d90591e 100644
--- a/tests/worker_coordinator/worker_coordinator_test.py
+++ b/tests/worker_coordinator/worker_coordinator_test.py
@@ -189,6 +189,21 @@ class WorkerCoordinatorTests(TestCase):
# Did we start all load generators? There is no specific mock assert
for this...
self.assertEqual(4, target.start_worker.call_count)
+ def test_creates_cluster_environment_info_device(self):
+ # pylint: disable=import-outside-toplevel
+ from solrorbit import telemetry
+ from solrorbit.client import SolrClient
+
+ target = self.create_test_worker_coordinator_target()
+ d = worker_coordinator.WorkerCoordinator(target, self.cfg,
client_factory_class=WorkerCoordinatorTests.StaticClientFactory)
+ sc = mock.MagicMock(spec=SolrClient)
+
+ devices = d._create_solr_telemetry_devices({"default": sc})
+
+ env_info = [device for device in devices if isinstance(device,
telemetry.ClusterEnvironmentInfo)]
+ self.assertEqual(1, len(env_info))
+ self.assertIs(sc, env_info[0].admin_client)
+
def test_client_reaches_join_point_others_still_executing(self):
target = self.create_test_worker_coordinator_target()
d = worker_coordinator.WorkerCoordinator(target, self.cfg,
client_factory_class=WorkerCoordinatorTests.StaticClientFactory)