Task · MDE-0048

Make client application-usage scheduler demand match 100-client batching

Description

Audit dimension 1 confirmed a live scheduler-accounting defect at the v2.0.0 release tree. src/meraki_dashboard_exporter/collectors/clients.py:60-64 budgets CLIENTS_APP_USAGE as one request per network, while clients.py:1255-1273 splits emitted client IDs into batches of 100 and makes one getNetworkClientsApplicationUsage request per batch. A network with 150 emitted clients is therefore costed as one request but performs two; at the configured 10,000-client cap it can perform 100. The adaptive solver can leave the group unstretched on understated demand and push avoidable load into 429 handling. tests/unit/test_clients_collector.py:923-950 proves the multi-call behavior, while tests/unit/test_clients_scheduler_gates.py:83-90 pins the incorrect one-call estimate. The implementation needs an explicit product choice between exact observed-client demand and a conservative bounded estimate; the current OrgShape has no client-count field.

Acceptance Criteria

Definition of Done

Implementation Plan

Add a failing 150-client scheduler-demand regression, implement a named conservative per-network cap using 100-client batches, then verify the bound does not force pathological priority-4 shedding.

Final Summary

Implemented bounded client application-usage demand from the validated per-network client cap, preserving the constant-cap scheduler policy without adding client count to OrgShape. Regression tests, just check, and just ci passed at 5e8d9c23b76a2f2edd531c15c776cbfbcc9134fa; exact-head CI 33843833956 and publication 33843966820 succeeded.

View the source file on GitHub