summaryrefslogtreecommitdiff
path: root/src/benchmark.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/benchmark.rs')
-rw-r--r--src/benchmark.rs32
1 files changed, 0 insertions, 32 deletions
diff --git a/src/benchmark.rs b/src/benchmark.rs
deleted file mode 100644
index b313868..0000000
--- a/src/benchmark.rs
+++ /dev/null
@@ -1,32 +0,0 @@
-use crate::chunk::DataChunk;
-use crate::chunkid::ChunkId;
-use crate::chunkmeta::ChunkMeta;
-
-// Generate a desired number of empty data chunks with id and metadata.
-pub struct ChunkGenerator {
- goal: u32,
- next: u32,
-}
-
-impl ChunkGenerator {
- pub fn new(goal: u32) -> Self {
- Self { goal, next: 0 }
- }
-}
-
-impl Iterator for ChunkGenerator {
- type Item = (ChunkId, String, ChunkMeta, DataChunk);
-
- fn next(&mut self) -> Option<Self::Item> {
- if self.next >= self.goal {
- None
- } else {
- let id = ChunkId::new();
- let checksum = id.sha256();
- let meta = ChunkMeta::new(&checksum);
- let chunk = DataChunk::new(vec![]);
- self.next += 1;
- Some((id, checksum, meta, chunk))
- }
- }
-}