summaryrefslogtreecommitdiff
path: root/src/main/java/bench/BenchConfig.java
blob: d26c48f1a9ed4b573b483a02c0bdcecdf0f3ac1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package bench;

import java.util.List;

public class BenchConfig {
    public enum Mode { DURATION, EVENTS }

    private int threads = Runtime.getRuntime().availableProcessors();
    private Mode mode = Mode.DURATION;
    private long durationSeconds = 10;
    private long totalEvents = 1_000_000;
    private long warmupSeconds = 3;
    private int messageSize = 100;
    private List<String> configs = List.of(
        "sync-immediate", "sync-buffered",
        "async-1k", "async-4k", "async-10k",
        "asyncapp-1k", "asyncapp-4k", "asyncapp-10k"
    );
    private String outputFile = null;

    public int getThreads() { return threads; }
    public void setThreads(int threads) { this.threads = threads; }

    public Mode getMode() { return mode; }
    public void setMode(Mode mode) { this.mode = mode; }

    public long getDurationSeconds() { return durationSeconds; }
    public void setDurationSeconds(long durationSeconds) { this.durationSeconds = durationSeconds; }

    public long getTotalEvents() { return totalEvents; }
    public void setTotalEvents(long totalEvents) { this.totalEvents = totalEvents; }

    public long getWarmupSeconds() { return warmupSeconds; }
    public void setWarmupSeconds(long warmupSeconds) { this.warmupSeconds = warmupSeconds; }

    public int getMessageSize() { return messageSize; }
    public void setMessageSize(int messageSize) { this.messageSize = messageSize; }

    public List<String> getConfigs() { return configs; }
    public void setConfigs(List<String> configs) { this.configs = configs; }

    public String getOutputFile() { return outputFile; }
    public void setOutputFile(String outputFile) { this.outputFile = outputFile; }

    public String generateMessage() {
        return "X".repeat(messageSize);
    }
}