test(providers): add ASV performance benchmark suite for the providers module #3022
No reviewers
Labels
No labels
auto/needs-reevaluation
controller-managed
auto/blocked-by-deps
auto/ci-timeout
auto/claimed-implementer
auto/claimed-merge
auto/claimed-reviewer
auto/driver-down
auto/invariant-violation
auto/last-attempt-tier-0
auto/last-attempt-tier-1
auto/last-attempt-tier-2
auto/last-attempt-tier-min
Automation Tracking
auto/needs-conflict-resolution
auto/needs-implementer
auto/postmortem
auto/ready-to-merge
auto/restart-throttled
auto/revert
auto/sentinel
auto/stale-inactivity
auto/unstable
Blocked
Bounty
$100
Bounty
$1000
Bounty
$10000
Bounty
$20
Bounty
$2000
Bounty
$250
Bounty
$50
Bounty
$500
Bounty
$5000
Bounty
$750
MoSCoW
Could have
MoSCoW
Must have
MoSCoW
Should have
Needs Feedback
Points
1
Points
13
Points
2
Points
21
Points
3
Points
34
Points
5
Points
55
Points
8
Points
88
Priority
Backlog
Priority
CI Blocker
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Signed-off: Owner
Signed-off: Scrum Master
Signed-off: Tech Lead
Spike
State
Completed
State
Duplicate
State
In Progress
State
In Review
State
Paused
State
Unverified
State
Verified
State
Wont Do
Type
Automation
Type
Bug
Type
Discussion
Type
Documentation
Type
Epic
Type
Feature
Type
Legendary
Type
Refactor
Type
Support
Type
Task
Type
Testing
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
cleveragents/cleveragents-core!3022
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "test/missing-asv-benchmarks-providers"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds 5 new ASV benchmark files under
benchmarks/covering all performance-sensitive paths in theprovidersmodule that lacked benchmark coverage. This closes the gap identified in #2800 by providing 68 benchmark methods across cost table construction, cost tracking, fallback selection, provider registry lookups, and LLM adapter instantiation.Changes
benchmarks/providers_cost_table_bench.py— Benchmarks forProviderCostTablecovering:benchmarks/providers_cost_tracker_bench.py— Benchmarks forCostTrackercovering:get_cost_entrydelegation to the underlying cost tablebenchmarks/providers_fallback_selector_bench.py— Benchmarks forFallbackSelectorcovering:benchmarks/providers_registry_bench.py— Benchmarks forProviderRegistrycovering:get_all_providersenumerationget_provider_infoby enum value and by string nameis_provider_configuredchecksbenchmarks/providers_llm_adapters_bench.py— Benchmarks for LLM adapter instantiation covering:LangChainChatProvider,AnthropicChatProvider,GoogleChatProvider,OpenAIChatProvider, andOpenRouterChatProviderDesign Decisions
cost_controls_bench.pyandprovider_selection_bench.pywere carefully reviewed to ensure zero duplication. All 68 new benchmark methods cover paths not already measured.MagicMockforSettingsobjects: Real API keys are not required in the benchmark environment. MockingSettingskeeps benchmarks hermetic and runnable in CI without credentials.setup()fixtures isolate measurement: Each benchmark class uses ASV'ssetup()hook to construct all prerequisite objects before the timed region begins, ensuring that only the target operation is measured.Testing
nox -e lint: ✅ PASSEDnox -e typecheck: ✅ PASSED (0 errors, 0 warnings)Modules Affected
benchmarks/providers_cost_table_bench.pybenchmarks/providers_cost_tracker_bench.pybenchmarks/providers_fallback_selector_bench.pybenchmarks/providers_registry_bench.pybenchmarks/providers_llm_adapters_bench.pyNo production source files were modified.
Related Issues
Closes #2800
Automated by CleverAgents Bot
Supervisor: Implementation | Agent: ca-issue-worker
🔒 Review claimed by reviewer-pool-1 [claim-token: reviewer-pool-1-3022-1775362000]
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-continuous-pr-reviewer
Review: APPROVED ✅
Summary
This PR adds 5 new ASV benchmark files (846 lines, 68 benchmark methods) covering all performance-sensitive paths in the
providersmodule that lacked benchmark coverage. The implementation is thorough, well-structured, and follows project conventions.Review Criteria
Specification Alignment ✅
providersmodule is a critical integration boundary implementing the Provider Registry abstraction perdocs/specification.md. Adding benchmark coverage for cost tracking, registry operations, fallback selection, and LLM adapter instantiation aligns with the project's Multi-Level Testing Mandate.Duplication Avoidance ✅
cost_controls_bench.py(covers basic CostEntry, single-call record_usage, check_plan_budget, check_daily_budget, estimate_cost, basic FallbackSelector.select) andprovider_selection_bench.py(covers registry init, get_default_provider_type, get_configured_providers, get_default_model).Code Quality ✅
setup()fixture isolation ensures only target operations are measuredCorrectness ✅
reset_provider_registry()calls properly prevent cross-benchmark contaminationprovider_selection_bench.pysetup()before each method)Security ✅
PR Metadata ✅
test(providers): add ASV performance benchmark suite for the providers moduleISSUES CLOSED: #2800footer presenttest/missing-asv-benchmarks-providersType/Testing(appropriate)CI Status ✅
No issues found. Approving for merge.
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-pr-self-reviewer