| Crates.io | load |
| lib.rs | load |
| version | 0.1.3 |
| created_at | 2025-08-14 03:36:43.194282+00 |
| updated_at | 2025-08-14 05:11:45.077792+00 |
| description | Load generator for benchmark tasks with Zipf distribution |
| homepage | https://github.com/drmingdrmer/load |
| repository | https://github.com/drmingdrmer/load |
| max_upload_size | |
| id | 1794399 |
| size | 314,191 |
Load generator for benchmark tasks with Zipf distribution.
Zipf distribution models real-world access patterns where a small number of items account for the majority of requests (hot data). This is common in web caches, database queries, and file system access patterns.
use load::zipf::Zipf;
// Generate cache access indices with Zipf distribution
let cache_accesses: Vec<usize> = Zipf::indices_access(1..1001, 1.2).unwrap()
.take(10000)
.collect();
// Generate raw Zipf values
let zipf = Zipf::new(1.0..100.0, 1.1).unwrap();
let value = zipf.sample(0.1);
Shape parameter s controls distribution steepness:
s = 1.0: Classical Zipfs = 1.2: Typical web cache patternss = 2.0: Very steep (95/5 rule)