analyzer

package
v0.0.0-...-b78484e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2022 License: BSD-2-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const CORR_INSUFFICIENT_SAMPLES = -3
View Source
const CORR_UNDEFINED = -2

Variables

This section is empty.

Functions

This section is empty.

Types

type Analyzer

type Analyzer struct {
	Config
	FlowDurations metrics.DurationHistogram
	// contains filtered or unexported fields
}

func NewAnalyzer

func NewAnalyzer(cfg Config) *Analyzer

func (*Analyzer) Analyze

func (a *Analyzer) Analyze(fs []*tracker.Flow) (s []*FlowStats)

func (*Analyzer) Metrics

func (a *Analyzer) Metrics() (m Metrics)

type Config

type Config struct {
	SamplerInterval        time.Duration     // sampler interval (for quantile and correlation weights)
	CumulantKind           stat.CumulantKind // cumulant for quantile calculations
	UnweightedCorrelations bool              // if true, correlations are unweighted
	UnweightedQuantiles    bool              // if true, quantiles are unweighted
	AdjustedCC1            bool              // if true, use adjusted correlation r_adj = r * (1 + (1-r^2)/2n)
	AdjustedCC2            bool              // if true, use adjusted correlation r_adj = sqrt(1 - ((1-r^2)*(n-1)) / (n-2))
	Log                    bool              // if true, logging is enabled
}

type FlowStats

type FlowStats struct {
	ID                        ID            // flow ID
	StartTime                 time.Time     // start time
	EndTime                   time.Time     // end time
	Duration                  time.Duration // duration from first to last sample
	Samples                   int           // number of unique samples
	SamplesDeduped            int           // number of samples de-duped
	Partial                   bool          // true if flow was pre-existing or had no last sample on shutdown
	Timestamps                bool          // true if flow had timestamps enabled (TCPI_OPT_TIMESTAMPS)
	SACK                      bool          // true if flow had SACK enabled (TCPI_OPT_SACK)
	ECN                       bool          // true if flow had ECN enabled (TCPI_OPT_ECN)
	ECNSeen                   bool          // true if at least one packet _received_ with ECT (TCPI_OPT_ECN_SEEN)
	MinRTTKernelms            float64       // minimum RTT as tracked by the kernel, in milliseconds
	MinRTTObservedms          float64       // minimum RTT in the observed samples
	MaxPacingRateKernelMbps   float64       // maximum pacing rate as tracked by the kernel, in Mbps
	MaxPacingRateObservedMbps float64       // maximum pacing rate in the observed samples
	RTTSummary                [7]float64    // RTT seven number summary
	RTTVarSummary             [7]float64    // RTT variance seven number summary
	CorrRTTCwnd               float64       // correlation between RTT and cwnd
	CorrRetransCwnd           float64       // correlation between retransmit rate and cwnd
	CorrPacingCwnd            float64       // correlation between pacing rate and cwnd
	TotalRetransmits          uint32        // the value of tcpi_total_retrans from the kernel on the last sample
	BytesAcked                uint64        // bytes acked
	// delivery stats only available in 4.18 and later
	//Delivered                 uint32        // packets delivered
	//DeliveredCE               uint32        // packets delivered and acked with ECE
	SendThroughputMbps float64 // mean send throughput in Mbps
}

A FlowStats contains the data and statistics that are saved to the output.

type ID

type ID struct {
	SrcIP         net.IP
	SrcPort       uint16
	DstIP         net.IP
	DstPort       uint16
	TstampStartNs uint64
}

An ID uniquely identifies flows within program execution. A monotonic timestamp from the first sample is added to distinguish between flows with the same 5-tuple.

type Metrics

type Metrics struct {
	AnalyzeTimes metrics.DurationStats
	sync.RWMutex
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL