Skip to content

Commit 6c0abad

Browse files
committed
update test payload in iggy-bench to json-like logs for compression
1 parent dbe8d90 commit 6c0abad

File tree

5 files changed

+16
-13
lines changed

5 files changed

+16
-13
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DEPENDENCIES.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,9 +481,8 @@ logos-codegen: 0.15.1, "Apache-2.0 OR MIT",
481481
logos-derive: 0.15.1, "Apache-2.0 OR MIT",
482482
lru-slab: 0.1.2, "Apache-2.0 OR MIT OR Zlib",
483483
lz4_flex: 0.11.5, "MIT",
484-
lzma-rust2: 0.15.4, "Apache-2.0",
485484
lz4_flex: 0.12.0, "MIT",
486-
lzma-rust2: 0.13.0, "Apache-2.0",
485+
lzma-rust2: 0.15.4, "Apache-2.0",
487486
macro_rules_attribute: 0.1.3, "MIT",
488487
macro_rules_attribute-proc_macro: 0.1.3, "MIT",
489488
matchers: 0.2.0, "MIT",

core/bench/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ human-repr = { workspace = true }
4747
iggy = { workspace = true }
4848
integration = { workspace = true }
4949
nonzero_lit = { workspace = true }
50-
rand = { workspace = true }
5150
rayon = "1.11.0"
5251
serde = { workspace = true }
5352
sysinfo = { workspace = true }

core/bench/src/utils/batch_generator.rs

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,20 @@ impl BenchmarkBatchGenerator {
4141
let max_len = message_size.max() as usize;
4242
let is_fixed = message_size.is_fixed() && messages_per_batch.is_fixed();
4343

44-
let template = r#"{"name": "example messasge payload", "description": "simulating realistic compressible data", "user": "test-user", "id": 42, "trace_id": "812Fr%210"}"#;
45-
let payload_bytes = template
46-
.as_bytes()
47-
.iter()
48-
.cycle()
49-
.take(max_len)
50-
.copied()
51-
.collect();
44+
let mut buf = Vec::with_capacity(max_len);
45+
let mut i = 0;
46+
while buf.len() < max_len {
47+
buf.extend_from_slice(
48+
format!(
49+
r#"{{"ts": "2000-01-{:02}T{:02}:{:02}:{:02}Z", "level": "info", "trace":{}, "command": "command-{}", "status": 200, "latency_ms": {}}}"#,
50+
i % 28, i % 24, i % 60, i % 60, i, i % 1000, i % 120
51+
)
52+
.as_bytes(),
53+
);
54+
i += 1;
55+
}
56+
buf.truncate(max_len);
57+
let payload_bytes: Bytes = Bytes::from(buf);
5258

5359
let mut batch_generator = Self {
5460
message_size,

core/common/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ figment = { workspace = true }
5656
flate2 = { workspace = true }
5757
human-repr = { workspace = true }
5858
humantime = { workspace = true }
59-
nix = { workspace = true }
6059
lz4_flex = { workspace = true }
60+
nix = { workspace = true }
6161
once_cell = { workspace = true }
6262
rcgen = "0.14.6"
6363
ring = "0.17.14"

0 commit comments

Comments
 (0)