1
0
Fork 0
loadr/lib/types.go

41 lines
935 B
Go

package lib
import (
"sync"
"time"
)
// PerformanceMetrics represents a thread-safe container for tracking
// performance statistics during load testing
type PerformanceMetrics struct {
Mu sync.Mutex
TotalRequests int32
TotalResponses int32
TotalLatency time.Duration
MaxLatency time.Duration
MinLatency time.Duration
ResponseCounters map[int]int32
RequestLatencies []RequestMetric
}
// RequestMetric represents a single request's performance metrics
type RequestMetric struct {
Timestamp time.Time
Duration time.Duration
StatusCode int
Verb string
}
// RequestError represents a detailed error that occurs during an HTTP request
type RequestError struct {
Verb string
URL string
Err error
}
// RequestPattern defines the characteristics of requests to be sent during load testing
type RequestPattern struct {
Verb string
Percentage float64
Sequence int
}