Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Acknowledgement ¶
type Acknowledgement struct { ThroughputMB float64 // Average throughput in megabyte/s at this datapoint ThroughputMb float64 // Average throughput in megabit/s at this datapoint TransferredMB int // Transfered amount in megabyte at this datapoint TransferredDuration time.Duration // Duration of transfer at this datapoint }
Acknowledgement is an individual datapoint
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter provides a throughput measurement service
func NewAdapter ¶
func NewAdapter( signaler string, key string, ice []string, config *AdapterConfig, ctx context.Context, ) *Adapter
NewAdapter creates the adapter
func (*Adapter) Acknowledgements ¶
func (a *Adapter) Acknowledgements() chan Acknowledgement
Acknowledgements returns a channel on which all individual datapoints will be sent
func (*Adapter) Close ¶
Close disconnects the adapter from the signaler and stops all measurements, resulting in the totals being yielded
func (*Adapter) GatherTotals ¶
func (a *Adapter) GatherTotals()
GatherTotals yields the total statistics
type AdapterConfig ¶
type AdapterConfig struct { *wrtcconn.AdapterConfig OnSignalerConnect func(string) // Handler to be called when the adapter has connected to the signaler OnPeerConnect func(string) // Handler to be called when the adapter has connected to a peer OnPeerDisconnected func(string) // Handler to be called when the adapter has received a message Server bool // Whether to act as the server PacketLength int // Length of the packet to measure latency with PacketCount int // Amount of packets to send before measuring }
AdapterConfig configures the adapter
type Totals ¶
type Totals struct { ThroughputAverageMB float64 // Average total throughput in megabyte/s ThroughputAverageMb float64 // Average total throughput in megabit/s TransferredMB int // Total transfered amount in megabyte TransferredDuration time.Duration // Total duration of transfer ThroughputMin float64 // Minimum measured throughput ThroughputMax float64 // Maximum measured throughput }
Totals are the total statistics
Click to show internal directories.
Click to hide internal directories.