Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PerfTestWebsocketCMD ¶
PerfTestWebsocketCMD creates a cobra command for websocket performance test
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a single WebSocket client worker.
func NewClient ¶
func NewClient(id int, url string, stats *statsCollector, sendInterval time.Duration, payloadData []byte, isJSON bool) *Client
NewClient creates a new WebSocket client worker.
type Statistics ¶
type Statistics struct {
URL string `json:"url"` // performed request URL
Duration float64 `json:"duration"` // seconds
// Connections
TotalConnections uint64 `json:"total_connections"`
SuccessConnections uint64 `json:"success_connections"`
FailedConnections uint64 `json:"failed_connections"`
AvgConnectLatency float64 `json:"avg_connect_latency"` // ms
MinConnectLatency float64 `json:"min_connect_latency"` // ms
MaxConnectLatency float64 `json:"max_connect_latency"` // ms
// Messages
TotalMessagesSent uint64 `json:"total_messages_sent"`
TotalMessagesReceived uint64 `json:"total_messages_received"`
SentMessageQPS float64 `json:"sent_message_qps"` // sent messages per second
ReceivedMessageQPS float64 `json:"received_message_qps"` // received messages per second
TotalBytesSent uint64 `json:"total_bytes_sent"` // bytes
TotalBytesReceived uint64 `json:"total_bytes_received"` // bytes
ErrorCount uint64 `json:"error_count"` // total errors
Errors []string `json:"errors"` // list of errors
}
func (*Statistics) Save ¶
func (s *Statistics) Save(filePath string) error
Click to show internal directories.
Click to hide internal directories.