Adjust minimum operations for JetStream benchmarks

Lower minimum amount of data / number of operations so that benchmarks 
can run in reasonable time.

Minimum amount of work should be controlled via `-benchtime` flag. But 
due to these hardcoded limits, some tests were taking too long.

e.g. Running for 2 minutes even with `-benchtime` set to 1 second.
This commit is contained in:
Marco Primi
2022-12-02 15:00:59 -08:00
parent 0c2727eef2
commit f20101370c
3 changed files with 9 additions and 9 deletions

View File

@@ -256,10 +256,10 @@ func BenchmarkJetStreamConsume(b *testing.B) {
messageSize int
minMessages int
}{
{1, 1, 10, 1_000_000}, // Single node, 10B messages, ~10MiB minimum
{1, 1, 1024, 100_000}, // Single node, 1KB messages, ~100MiB minimum
{3, 3, 10, 1_000_000}, // Cluster, R3, 10B messages, ~10MiB minimum
{3, 3, 1024, 100_000}, // Cluster, R3, 1KB messages, ~100MiB minimum
{1, 1, 10, 100_000}, // Single node, 10B messages, ~1MiB minimum
{1, 1, 1024, 1_000}, // Single node, 1KB messages, ~1MiB minimum
{3, 3, 10, 100_000}, // Cluster, R3, 10B messages, ~1MiB minimum
{3, 3, 1024, 1_000}, // Cluster, R3, 1KB messages, ~1MiB minimum
}
//Each of the cases above is run with each of the consumer types

View File

@@ -31,7 +31,7 @@ func BenchmarkJetStreamKV(b *testing.B) {
kvNamePrefix = "B_"
keyPrefix = "K_"
seed = 12345
minOps = 100_000
minOps = 1_000
)
runKVGet := func(b *testing.B, kvs []nats.KeyValue, keys []string) int {

View File

@@ -140,10 +140,10 @@ func BenchmarkJetStreamPublish(b *testing.B) {
numSubjects int
minMessages int
}{
{1, 1, 10, 1, 1_000_000}, // Single node, 10B messages, ~10MB minimum
{1, 1, 1024, 1, 500_000}, // Single node, 1KB messages, ~500MB minimum
{3, 3, 10, 1, 500_000}, // 3-nodes cluster, R=3, 10B messages, ~5MB minimum
{3, 3, 1024, 1, 100_000}, // 3-nodes cluster, R=3, 10B messages, ~100MB minimum
{1, 1, 10, 1, 100_000}, // Single node, 10B messages, ~1MB minimum
{1, 1, 1024, 1, 1_000}, // Single node, 1KB messages, ~1MB minimum
{3, 3, 10, 1, 100_000}, // 3-nodes cluster, R=3, 10B messages, ~1MB minimum
{3, 3, 1024, 1, 1_000}, // 3-nodes cluster, R=3, 10B messages, ~1MB minimum
}
// All the cases above are run with each of the publisher cases below