test: add gas benchmarks for insurance scheduler workloads#420
Open
Mosas2000 wants to merge 1 commit intoRemitwise-Org:mainfrom
Open
test: add gas benchmarks for insurance scheduler workloads#420Mosas2000 wants to merge 1 commit intoRemitwise-Org:mainfrom
Mosas2000 wants to merge 1 commit intoRemitwise-Org:mainfrom
Conversation
Add comprehensive gas benchmarks for insurance premium schedule operations: - Create schedule: single and with 50 existing schedules - Modify schedule: single and middle of 100 schedules - Cancel schedule: single and middle of 50 schedules - Execute due schedules: single, 10 of 50, all 50, with missed periods - Query schedules: empty, 50, 100 worst-case, owner isolation - Policy aggregation: get_total_monthly_premium with 100 policies Benchmark implementation: - Add PremiumSchedule type with id, policy_id, owner, next_due, interval, active, and missed_count fields - Implement schedule lifecycle functions in the contract - Add TTL extension to prevent storage archival during time-advancing tests - Use high min_temp_entry_ttl and min_persistent_entry_ttl in test environment Update benchmarks/README.md with documentation for: - Running insurance benchmarks - All benchmark scenarios covered - JSON output format Remove broken stress_tests.rs (pre-existing incompatible API usage)
Contributor
|
Please resolve the conflicts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds 17 gas benchmarks for insurance premium schedule operations covering create, modify, cancel, execute, and query paths under heavy workloads.
Benchmarks include:
Schedule lifecycle with 50-100 existing entries
Execute due schedules (single, partial, all due, missed periods)
Query performance with owner isolation validation
Run with: RUST_TEST_THREADS=1 cargo test -p insurance --test gas_bench -- --nocapture
Closes #286