Documentation ¶
Index ¶
- Variables
- func GetMemoryUsage() uint64
- type DummySuite
- func (ds *DummySuite) AcquireClient() (*net.UDPConn, error)
- func (ds *DummySuite) RunReadBenchmark(ctx context.Context, numClients int, numMessagesPerClient int, report *Report) error
- func (ds *DummySuite) RunWriteBenchmark(ctx context.Context, numClients int, numMessagesPerClient int, report *Report) error
- func (ds *DummySuite) Start(ctx context.Context) error
- func (ds *DummySuite) Stop(ctx context.Context) error
- type QuicSuite
- func (qs *QuicSuite) AcquireClient(ctx context.Context) (quic.Connection, quic.Stream, error)
- func (qs *QuicSuite) RunReadBenchmark(ctx context.Context, numClients int, numMessagesPerClient int, report *Report) error
- func (qs *QuicSuite) RunWriteBenchmark(ctx context.Context, numClients int, numMessagesPerClient int, report *Report) error
- func (qs *QuicSuite) Start(ctx context.Context) error
- func (qs *QuicSuite) Stop(ctx context.Context) error
- type Report
- type SuiteManager
- func (sm *SuiteManager) RegisterSuite(suiteType SuiteType, suite TransportSuite)
- func (sm *SuiteManager) RunReadBenchmark(ctx context.Context, suiteType SuiteType, numClients int, ...) error
- func (sm *SuiteManager) RunWriteBenchmark(ctx context.Context, suiteType SuiteType, numClients int, ...) error
- func (sm *SuiteManager) Start(ctx context.Context, suiteType SuiteType) error
- func (sm *SuiteManager) Stop(ctx context.Context, suiteType SuiteType) error
- type SuiteType
- type TcpSuite
- func (ts *TcpSuite) AcquireClient() (*net.TCPConn, error)
- func (ts *TcpSuite) RunReadBenchmark(ctx context.Context, numClients int, numMessagesPerClient int, report *Report) error
- func (ts *TcpSuite) RunWriteBenchmark(ctx context.Context, numClients int, numMessagesPerClient int, report *Report) error
- func (ts *TcpSuite) Start(ctx context.Context) error
- func (ts *TcpSuite) Stop(ctx context.Context) error
- type TransportSuite
- type UdpSuite
- func (us *UdpSuite) AcquireClient() (*net.UDPConn, error)
- func (us *UdpSuite) RunReadBenchmark(ctx context.Context, numClients int, numMessagesPerClient int, report *Report) error
- func (us *UdpSuite) RunWriteBenchmark(ctx context.Context, numClients int, numMessagesPerClient int, report *Report) error
- func (us *UdpSuite) Start(ctx context.Context) error
- func (us *UdpSuite) Stop(ctx context.Context) error
- type UdsSuite
- func (us *UdsSuite) AcquireClient() (*net.UnixConn, error)
- func (us *UdsSuite) RunReadBenchmark(ctx context.Context, numClients int, numMessagesPerClient int, report *Report) error
- func (us *UdsSuite) RunWriteBenchmark(ctx context.Context, numClients int, numMessagesPerClient int, report *Report) error
- func (us *UdsSuite) Start(ctx context.Context) error
- func (us *UdsSuite) Stop(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidSuiteType = errors.New("invalid suite type")
ErrInvalidSuiteType is returned when an unsupported SuiteType is provided.
Functions ¶
func GetMemoryUsage ¶
func GetMemoryUsage() uint64
GetMemoryUsage captures the current memory usage in bytes.
Types ¶
type DummySuite ¶
type DummySuite struct {
// contains filtered or unexported fields
}
DummySuite represents the benchmarking suite with buffer reuse and lighter LatencyHistogram.
func NewDummySuite ¶
func NewDummySuite(fdb *fdb.FDB, latencySampling int) *DummySuite
NewDummySuite initializes the DummySuite with buffer reuse and latency sampling settings.
func (*DummySuite) AcquireClient ¶
func (ds *DummySuite) AcquireClient() (*net.UDPConn, error)
AcquireClient creates and returns a new UDP client.
func (*DummySuite) RunReadBenchmark ¶
func (ds *DummySuite) RunReadBenchmark(ctx context.Context, numClients int, numMessagesPerClient int, report *Report) error
RunReadBenchmark benchmarks reading messages from the Dummy server.
func (*DummySuite) RunWriteBenchmark ¶
func (ds *DummySuite) RunWriteBenchmark(ctx context.Context, numClients int, numMessagesPerClient int, report *Report) error
RunWriteBenchmark benchmarks writing messages through the Dummy server.
type QuicSuite ¶
type QuicSuite struct {
// contains filtered or unexported fields
}
QuicSuite represents the QUIC-specific benchmark suite.
func NewQuicSuite ¶
NewQuicSuite initializes the QuicSuite with buffer reuse and latency sampling settings.
func (*QuicSuite) AcquireClient ¶
AcquireClient sets up a QUIC client and stream.
func (*QuicSuite) RunReadBenchmark ¶
func (qs *QuicSuite) RunReadBenchmark(ctx context.Context, numClients int, numMessagesPerClient int, report *Report) error
RunReadBenchmark benchmarks reading messages from the QUIC server.
func (*QuicSuite) RunWriteBenchmark ¶
func (qs *QuicSuite) RunWriteBenchmark(ctx context.Context, numClients int, numMessagesPerClient int, report *Report) error
RunWriteBenchmark benchmarks writing messages through the QUIC server.
type Report ¶
type Report struct { TotalClients int `json:"total_clients"` MessagesPerClient int `json:"messages_per_client"` TotalMessages int `json:"total_messages"` SuccessMessages int `json:"success_messages"` FailedMessages int `json:"failed_messages"` TotalDuration time.Duration `json:"total_duration"` AvgLatency time.Duration `json:"avg_latency"` Throughput float64 `json:"throughput"` // Messages per second MemoryUsed uint64 `json:"memory_used"` LatencyHistogram []time.Duration `json:"latency_histogram"` Jitter float64 `json:"jitter"` // Latency jitter (standard deviation) LatencyStdDev float64 `json:"latency_std_dev"` // Standard deviation of latencies P50Latency time.Duration `json:"p50_latency"` // 50th percentile (median) P90Latency time.Duration `json:"p90_latency"` // 90th percentile P99Latency time.Duration `json:"p99_latency"` // 99th percentile }
Report holds the results of the benchmark.
func (*Report) ExportToJSON ¶
ExportToJSON exports the benchmark report to a JSON file.
func (*Report) Finalize ¶
func (r *Report) Finalize()
Finalize aggregates the latency data and updates the benchmark report.
func (*Report) PrintReport ¶
func (r *Report) PrintReport()
PrintReport prints the benchmark report to the console.
type SuiteManager ¶
type SuiteManager struct { Suites map[SuiteType]TransportSuite // contains filtered or unexported fields }
SuiteManager manages multiple benchmarking suites for different transport types.
func NewSuiteManager ¶
func NewSuiteManager(fdb *fdb.FDB) *SuiteManager
NewSuiteManager creates a new SuiteManager capable of managing multiple transport-specific suites.
func (*SuiteManager) RegisterSuite ¶
func (sm *SuiteManager) RegisterSuite(suiteType SuiteType, suite TransportSuite)
RegisterSuite registers a transport-specific suite with the manager.
func (*SuiteManager) RunReadBenchmark ¶
func (sm *SuiteManager) RunReadBenchmark(ctx context.Context, suiteType SuiteType, numClients int, numMessagesPerClient int, report *Report) error
RunReadBenchmark executes the read benchmarking logic for the specified SuiteType.
func (*SuiteManager) RunWriteBenchmark ¶
func (sm *SuiteManager) RunWriteBenchmark(ctx context.Context, suiteType SuiteType, numClients int, numMessagesPerClient int, report *Report) error
RunWriteBenchmark executes the write benchmarking logic for the specified SuiteType.
type SuiteType ¶
type SuiteType string
SuiteType represents different types of benchmarking suites (e.g., QUIC, UDS, etc.)
type TcpSuite ¶
type TcpSuite struct {
// contains filtered or unexported fields
}
TcpSuite represents the benchmarking suite for TCP with buffer reuse and latency sampling.
func NewTcpSuite ¶
NewTcpSuite initializes the TcpSuite with buffer reuse and latency sampling settings.
func (*TcpSuite) AcquireClient ¶
AcquireClient creates and returns a new TCP client.
func (*TcpSuite) RunReadBenchmark ¶
func (ts *TcpSuite) RunReadBenchmark(ctx context.Context, numClients int, numMessagesPerClient int, report *Report) error
RunReadBenchmark benchmarks reading messages from the TCP server.
func (*TcpSuite) RunWriteBenchmark ¶
func (ts *TcpSuite) RunWriteBenchmark(ctx context.Context, numClients int, numMessagesPerClient int, report *Report) error
RunWriteBenchmark benchmarks writing messages through the TCP server.
type TransportSuite ¶
type TransportSuite interface { Start(ctx context.Context) error Stop(ctx context.Context) error RunWriteBenchmark(ctx context.Context, numClients int, numMessagesPerClient int, report *Report) error RunReadBenchmark(ctx context.Context, numClients int, numMessagesPerClient int, report *Report) error }
TransportSuite defines a common interface that all transport-specific suites must implement.
type UdpSuite ¶
type UdpSuite struct {
// contains filtered or unexported fields
}
UdpSuite represents the benchmarking suite for UDP with buffer reuse and latency sampling.
func NewUdpSuite ¶
NewUdpSuite initializes the UdpSuite with buffer reuse and latency sampling settings.
func (*UdpSuite) AcquireClient ¶
AcquireClient creates and returns a new UDP client.
func (*UdpSuite) RunReadBenchmark ¶
func (us *UdpSuite) RunReadBenchmark(ctx context.Context, numClients int, numMessagesPerClient int, report *Report) error
RunReadBenchmark benchmarks reading messages from the UDP server.
func (*UdpSuite) RunWriteBenchmark ¶
func (us *UdpSuite) RunWriteBenchmark(ctx context.Context, numClients int, numMessagesPerClient int, report *Report) error
RunWriteBenchmark benchmarks writing messages through the UDP server.
type UdsSuite ¶
type UdsSuite struct {
// contains filtered or unexported fields
}
UdsSuite represents the benchmarking suite for UDS with buffer reuse and latency sampling.
func NewUdsSuite ¶
NewUdsSuite initializes the UdsSuite with buffer reuse and latency sampling settings.
func (*UdsSuite) AcquireClient ¶
AcquireClient creates and returns a new UDS client.
func (*UdsSuite) RunReadBenchmark ¶
func (us *UdsSuite) RunReadBenchmark(ctx context.Context, numClients int, numMessagesPerClient int, report *Report) error
RunReadBenchmark benchmarks reading messages from the UDS server.
func (*UdsSuite) RunWriteBenchmark ¶
func (us *UdsSuite) RunWriteBenchmark(ctx context.Context, numClients int, numMessagesPerClient int, report *Report) error
RunWriteBenchmark benchmarks writing messages through the UDS server.