Documentation
¶
Index ¶
- type ContractData
- type DeviceCache
- type LatencyManager
- func (l *LatencyManager) GetDeviceCache() []serviceability.Device
- func (l *LatencyManager) GetResultsCache() []LatencyResult
- func (l *LatencyManager) ServeLatency(w http.ResponseWriter, r *http.Request)
- func (l *LatencyManager) Start(ctx context.Context, programId string, rpcEndpoint string, ...) error
- type LatencyResult
- type LatencyResults
- type ProberFunc
- type SmartContractorFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContractData ¶
type ContractData struct {
Locations []serviceability.Location
Devices []serviceability.Device
Exchanges []serviceability.Exchange
Links []serviceability.Link
Users []serviceability.User
}
func FetchContractData ¶
type DeviceCache ¶
type DeviceCache struct {
Devices []serviceability.Device
Lock sync.Mutex
}
type LatencyManager ¶
type LatencyManager struct {
SmartContractFunc SmartContractorFunc
ProberFunc ProberFunc
DeviceCache *DeviceCache
ResultsCache *LatencyResults
}
func NewLatencyManager ¶
func NewLatencyManager(s SmartContractorFunc, p ProberFunc) *LatencyManager
func (*LatencyManager) GetDeviceCache ¶
func (l *LatencyManager) GetDeviceCache() []serviceability.Device
func (*LatencyManager) GetResultsCache ¶
func (l *LatencyManager) GetResultsCache() []LatencyResult
func (*LatencyManager) ServeLatency ¶
func (l *LatencyManager) ServeLatency(w http.ResponseWriter, r *http.Request)
type LatencyResult ¶
type LatencyResult struct {
Min int64 `json:"min_latency_ns"`
Max int64 `json:"max_latency_ns"`
Avg int64 `json:"avg_latency_ns"`
Loss float64 `json:"loss_percentage"`
Device serviceability.Device `json:"-"`
Reachable bool `json:"reachable"`
}
func UdpPing ¶
func UdpPing(ctx context.Context, d serviceability.Device) LatencyResult
func (*LatencyResult) MarshalJSON ¶
func (l *LatencyResult) MarshalJSON() ([]byte, error)
type LatencyResults ¶
type LatencyResults struct {
Results []LatencyResult
Lock sync.RWMutex `json:"-"`
}
func (*LatencyResults) MarshalJSON ¶
func (l *LatencyResults) MarshalJSON() ([]byte, error)
type ProberFunc ¶
type ProberFunc func(context.Context, serviceability.Device) LatencyResult
type SmartContractorFunc ¶
Click to show internal directories.
Click to hide internal directories.