syahra712 opened a new pull request, #137:
URL: https://github.com/apache/solr-orbit/pull/137

   ### Description
   `docs/reference/telemetry.md` documents `--telemetry-params 
collection-stats-sample-interval:60` for the always-on collection stats device. 
However, `_create_solr_telemetry_devices` built `SolrCollectionStats` without a 
`sample_interval_s`, so the device always polled every 30 s.
   
   This PR reads `collection-stats-sample-interval` from the telemetry params, 
with a default of 30, and passes it to `SolrCollectionStats`. Like `ShardStats` 
with `shard-stats-sample-interval`, `SolrCollectionStats` now raises 
`SystemSetupError` for values <= 0. Otherwise a zero interval would make 
`_poll_loop` poll Solr in a tight loop.
   
   ### Issues Resolved
   Fixes #136 (found while looking into #5)
   
   ### Testing
   - [x] New functionality includes testing
   
   - 
`tests/worker_coordinator/worker_coordinator_test.py::WorkerCoordinatorTests::test_collection_stats_uses_sample_interval_param`
 sets `collection-stats-sample-interval: 7` and checks the created device's 
interval. On `main` it fails with `7 != 30.0`.
   - 
`tests/unit/solr/test_telemetry.py::TestSolrCollectionStats::test_rejects_non_positive_sample_interval`
 checks that 0 and -5 are rejected.
   - The full `tests/` suite passes locally on Python 3.12 (1176 passed, 5 
skipped), and `ruff check .` passes. I haven't run the integration suite 
(`it/`).
   
   This touches the same list in `_create_solr_telemetry_devices` as #135, but 
different lines, so either can merge first.
   
   ---
   By submitting this pull request, I confirm that my contribution is made 
under the terms of the Apache 2.0 license.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to