Documentation
¶
Overview ¶
Package latency tracks the global network connectivity statistics.
Index ¶
Constants ¶
View Source
const ( StateNameLatency = "network-latency" StateKeyLatencyData = "data" StateKeyLatencyEncoding = "encoding" StateKeyLatencyEncodingJSON = "json" )
View Source
const Name = "network-latency"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Query query_config.Config `json:"query"`
RegionCodes []string `json:"region_codes"`
}
type Output ¶
type Output struct {
RegionLatencies []RegionLatency `json:"region_latency"`
}
func ParseOutputJSON ¶
func ParseStatesToOutput ¶
func ParseStatesToOutput(states ...components.State) (*Output, error)
type RegionLatency ¶
type RegionLatency struct {
// RegionID/RegionCode list is available at https://login.tailscale.com/derpmap/default
RegionID int `json:"region_id"` // RegionID is the DERP region ID
RegionCode string `json:"region_code"` // RegionCode is the three-letter code for the region
RegionName string `json:"region_name"` // RegionName is the human-readable name of the region (e.g. "Chicago")
Latency time.Duration `json:"latency"` // Latency is the round-trip time to the region
LatencyHumanized string `json:"latency_humanized"` // LatencyHumanized is the human-readable version of the latency, in milliseconds
}
Click to show internal directories.
Click to hide internal directories.