sui_rpc_benchmark/
config.rs

1// Copyright (c) Mysten Labs, Inc.
2// SPDX-License-Identifier: Apache-2.0
3
4use std::collections::HashSet;
5use std::time::Duration;
6
7#[derive(Debug, Clone)]
8pub struct BenchmarkConfig {
9    /// Number of concurrent clients
10    pub concurrency: usize,
11    /// Duration to run the benchmark in seconds
12    /// If None, the benchmark will run until all requests are processed
13    pub duration: Option<Duration>,
14    /// Optional path to a jsonl file for JSON RPC benchmark.
15    /// The file contains a list of JSON RPC requests that are collected from Grafana,
16    /// and will be run concurrently by the JSON RPC benchmark runner.
17    pub json_rpc_file_path: Option<String>,
18    /// List of methods to skip during benchmark.
19    /// These methods will not be sent to the JSON RPC server.
20    pub json_rpc_methods_to_skip: HashSet<String>,
21}
22
23impl Default for BenchmarkConfig {
24    fn default() -> Self {
25        Self {
26            concurrency: 50,
27            duration: None,
28            json_rpc_file_path: None,
29            json_rpc_methods_to_skip: HashSet::new(),
30        }
31    }
32}