Commit 50e0c11
committed
feat: add wrap-around and time-based iteration support
Iterator cycling features for workloads exceeding keyspace size:
- Add duration_ms to SamplingConfig for time-based iteration limits
- RandomIter cycles when limit > range_size (e.g., 1M requests on 100K keys)
- SequentialIter auto-enables wrap_around when duration_ms is set
- FilterContext tracks start_time_ms and checks both count and duration limits
New tests for multi-threaded wrap-around behavior:
- test_random_cycling_limit_exceeds_keyspace
- test_random_cycling_multithreaded
- test_random_duration_based_cycling / _multithreaded
- test_sequential_duration_based / _multithreaded
- test_partitioned_with_limit / _multithreaded_disjoint
- test_delete_iter_single_pass
- test_limit_with_duration_limit_wins
- test_duration_with_limit_duration_wins
Documentation updates with examples for:
- Wrap-around mode (.wrap_around())
- Cycling with limit > keyspace
- Time-based iteration (duration_ms)1 parent 713fa2d commit 50e0c11
3 files changed
Lines changed: 618 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
71 | 76 | | |
72 | 77 | | |
73 | 78 | | |
| |||
92 | 97 | | |
93 | 98 | | |
94 | 99 | | |
| 100 | + | |
95 | 101 | | |
96 | 102 | | |
97 | 103 | | |
| |||
117 | 123 | | |
118 | 124 | | |
119 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
120 | 136 | | |
121 | 137 | | |
122 | 138 | | |
| |||
164 | 180 | | |
165 | 181 | | |
166 | 182 | | |
| 183 | + | |
167 | 184 | | |
168 | 185 | | |
169 | 186 | | |
| |||
224 | 241 | | |
225 | 242 | | |
226 | 243 | | |
| 244 | + | |
| 245 | + | |
227 | 246 | | |
228 | 247 | | |
229 | 248 | | |
230 | 249 | | |
231 | 250 | | |
232 | 251 | | |
233 | 252 | | |
| 253 | + | |
234 | 254 | | |
235 | 255 | | |
236 | 256 | | |
237 | 257 | | |
238 | 258 | | |
| 259 | + | |
239 | 260 | | |
240 | 261 | | |
241 | 262 | | |
242 | | - | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
243 | 274 | | |
244 | 275 | | |
245 | | - | |
246 | | - | |
247 | | - | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
248 | 281 | | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
249 | 290 | | |
250 | 291 | | |
251 | 292 | | |
| |||
0 commit comments