Documentation ¶
Overview ¶
Package tlsping measures the time needed for establishing TLS connections
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Dont perform TLS handshake. Only measure the time for // estasblishing the TCP connection AvoidTLSHandshake bool // Don't verify server certificate. Used relevant if // the TLS handshake is performed InsecureSkipVerify bool // Set of root certificate authorities to use to verify the server // certificate. This is only relevant when measuring the time spent // in the TLS handshake. // If nil, the host's set of root certificate authorities is used. RootCAs *x509.CertPool // Number of times to connect. The time spent by every connection will // be measured and the results will be summarized. Count int }
Config is used to configure how to time the TLS connection
type PingResult ¶
type PingResult struct { // Target host name Host string // IP Address of the host used for these measurements IPAddr string // Address of the target, in the form hostname:port Address string // Number of measurements summarized in this result Count int // Minimum and maximum observed connection times, in seconds Min, Max float64 // Average and standard deviation of the observed connection // times, in seconds Avg, Std float64 }
PingResult contains summary statistics of the measured connection times
func Ping ¶
func Ping(addr string, config *Config) (PingResult, error)
Ping establishes network connections to the specified network addr and returns summary statistics of the time spent establishing those connections. The operation is governed by the provided configuration. It returns an error if at least one of the connections fails. addr is of the form 'hostname:port' The returned results do not include the time spent calling the DNS for translating the host name to IP address. This resolution is performed once and a single of retrieved IP addresses is used for all connections.
func (*PingResult) AvgStr ¶
func (r *PingResult) AvgStr() string
func (*PingResult) MaxStr ¶
func (r *PingResult) MaxStr() string
func (*PingResult) MinStr ¶
func (r *PingResult) MinStr() string
func (*PingResult) StdStr ¶
func (r *PingResult) StdStr() string