Documentation ¶
Index ¶
- Constants
- func Run(ctx context.Context, cmd Command) error
- type AmbiguousNodeIDError
- type Analyze
- type AndFilter
- type BoolFilter
- type ChartsFCT
- type ChartsTimeSeries
- type Codec
- type Codecs
- type Command
- type Config
- type DataFileUnsetError
- type DuplicatePathError
- type DuplicateResultPrefixError
- type DuplicateTestIDError
- type EmitLog
- type EmitSysInfo
- type Encode
- type FileRef
- type FlowSeries
- type GoodputPoint
- type Index
- type InitCommand
- type LinkError
- type LogEntry
- type MultiReport
- type OrFilter
- type PacketAnalysis
- type RegexFilter
- type Report
- type ReportCommand
- type ReportInfo
- type ResultInfo
- type ResultReader
- type ResultWriter
- type Results
- type RunCommand
- type RunInfo
- type SaveFiles
- type Server
- type ServerCommand
- type StreamAnalysis
- type Test
- func (t *Test) DataHasError(rw resultRW) (hasError bool, err error)
- func (t *Test) DataReader(rw resultRW) (rc io.ReadCloser, err error)
- func (t *Test) DataWriter(rw resultRW) (wc io.WriteCloser, err error)
- func (t *Test) LinkPriorData(rw resultRW) (err error)
- func (t *Test) RW(work resultRW) resultRW
- type TestFilter
- type TestID
- type Tests
- type UnionError
- type VetCommand
Constants ¶
const LinuxSSThreshInfinity = 2147483647
LinuxSSThreshInfinity is the initial value of ssthresh in Linux.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AmbiguousNodeIDError ¶
AmbiguousNodeIDError is returned when multiple Nodes use the same ID but with different field values.
func (AmbiguousNodeIDError) Error ¶
func (a AmbiguousNodeIDError) Error() string
Error implements error
type Analyze ¶ added in v0.4.0
type Analyze struct { }
Analyze is a reporter that processes stream and packet data for reports. This must be in the Report pipeline *before* reporters that require it.
type AndFilter ¶
type AndFilter []TestFilter
AndFilter accepts a Test if each of its TestFilters accepts it. AndFilter panics if it has no TestFilters.
type BoolFilter ¶ added in v0.4.0
type BoolFilter bool
BoolFilter is a TestFilter that accepts (if true) or rejects all Tests.
func (BoolFilter) Accept ¶ added in v0.4.0
func (b BoolFilter) Accept(test *Test) bool
Accept implements TestFilter.
type ChartsFCT ¶
type ChartsFCT struct { // To lists the names of files to execute the template to. A file of "-" // emits to stdout. To []string // Series matches Flows to series. Series []FlowSeries // Options is an arbitrary structure of Charts options, with defaults // defined in config.cue. // https://developers.google.com/chart/interactive/docs/gallery/scatterchart#configuration-options Options map[string]any }
ChartsFCT is a reporter that makes time series plots using Google Charts.
type ChartsTimeSeries ¶
type ChartsTimeSeries struct { // FlowLabel sets custom labels for Flows. FlowLabel map[node.Flow]string // To lists the names of files to execute the template to. A file of "-" // emits to stdout. To []string // Options is an arbitrary structure of Charts options, with defaults // defined in config.cue. // https://developers.google.com/chart/interactive/docs/gallery/linechart#configuration-options Options map[string]any }
ChartsTimeSeries is a reporter that makes time series plots using Google Charts.
type Codec ¶ added in v0.4.0
type Codec struct { ID string Extension []string Encode string EncodeArg []string EncodePriority int Decode string DecodeArg []string DecodePriority int }
Codec configures a file encoder/decoder.
type Command ¶
type Command interface {
// contains filtered or unexported methods
}
A Command is an Antler command.
type Config ¶
type Config struct { Test Tests MultiReport []MultiReport Results Results Server Server }
Config is the Antler configuration, loaded from CUE.
type DataFileUnsetError ¶ added in v0.4.0
type DataFileUnsetError struct {
Test *Test
}
DataFileUnsetError is returned by DataWriter or DataReader when the Test's DataFile field is empty, so no data may be read or written. The Test field is the corresponding Test.
func (DataFileUnsetError) Error ¶ added in v0.4.0
func (n DataFileUnsetError) Error() string
Error implements error
type DuplicatePathError ¶ added in v0.5.0
type DuplicatePathError struct {
Path []string
}
DuplicatePathError is returned when multiple Tests have the same Path.
func (DuplicatePathError) Error ¶ added in v0.5.0
func (d DuplicatePathError) Error() string
Error implements error
type DuplicateResultPrefixError ¶ added in v0.4.0
type DuplicateResultPrefixError struct {
ResultPrefix []string
}
DuplicateResultPrefixError is returned when multiple Tests have the same ResultPrefix.
func (DuplicateResultPrefixError) Error ¶ added in v0.4.0
func (d DuplicateResultPrefixError) Error() string
Error implements error
type DuplicateTestIDError ¶
type DuplicateTestIDError struct {
ID []TestID
}
DuplicateTestIDError is returned when multiple Tests have the same ID.
func (DuplicateTestIDError) Error ¶
func (d DuplicateTestIDError) Error() string
Error implements error
type EmitLog ¶
type EmitLog struct { // To lists the destinations to send output to. "-" sends output to stdout, // and everything else sends output to the named file. If To is empty, // output is emitted to stdout. To []string // Sort, if true, indicates to gather the logs, sort them by time, and emit // them after "in" is closed. Sort bool }
EmitLog is a reporter that emits LogEntry's to files and/or stdout.
type EmitSysInfo ¶ added in v0.4.0
type EmitSysInfo struct { // To lists the destinations to send output to. "-" sends output to stdout, // and everything else sends output to the named file. If To is empty, // output is emitted to stdout. If two contains the verb %s, it is replaced // by the Node ID. To []string }
EmitSysInfo is a reporter that emits SysInfoData's to files and/or stdout.
type Encode ¶ added in v0.4.0
type Encode struct { File []string // list of glob patterns of files to encode Extension string // extension for newly encoded files (e.g. ".gz") ReEncode bool // if true, allow re-encoding of file Destructive bool // if true, delete originals upon success }
Encode is a reporter that encodes files referenced by FileRefs.
type FileRef ¶ added in v0.4.0
type FileRef struct {
Name string
}
FileRef is sent as a data item by SaveFiles to record the presence of a file with the specified Name, even after its FileData items may have been consumed.
type FlowSeries ¶
FlowSeries groups flows into series by matching the Flow ID with a Regex.
func (*FlowSeries) Compile ¶
func (s *FlowSeries) Compile() (err error)
Compile compiles Pattern to a Regexp.
type GoodputPoint ¶ added in v0.5.0
type GoodputPoint struct { // T is the time relative to the start of the earliest stream. T metric.RelativeTime // Goodput is the goodput bitrate. Goodput metric.Bitrate }
GoodputPoint is a single Goodput data point.
type Index ¶ added in v0.5.0
type Index struct { To string GroupBy string Title string ExcludeFile []string sync.Mutex // contains filtered or unexported fields }
Index is a reporter that creates an index.html file for a Group.
type InitCommand ¶ added in v0.7.0
type InitCommand struct { Package string // package name, or empty for parent directory name // WritingPackage is called before the package is written. WritingPackage func(pkg string) // WrotePackage is called after the package was written. WrotePackage func(pkg string) // WritingFile is called before a package file is written. WritingFile func(name string) // WroteFile is called after a package file was written. WroteFile func(name string) }
InitCommand creates a new test package in the current directory.
type LinkError ¶ added in v0.4.0
type LinkError struct {
Name string
}
LinkError is returned by resultRW.Link when the named file could not be found in any prior result.
type LogEntry ¶ added in v0.4.0
A LogEntry returns a node.LogEntry that should be logged. The method name GetLogEntry is non-idiomatic so that node.LogEntry may be embedded in implementations.
type MultiReport ¶ added in v0.5.0
type MultiReport struct { ID TestID // contains filtered or unexported fields }
MultiReport represents the MultiReport configuration from CUE.
type OrFilter ¶
type OrFilter []TestFilter
OrFilter accepts a Test if any of its TestFilters accepts it. OrFilter panics if it has no TestFilters.
type PacketAnalysis ¶ added in v0.5.0
type PacketAnalysis struct { // data Flow node.Flow Client node.PacketInfo Server node.PacketInfo ClientSent []node.PacketIO ClientRcvd []node.PacketIO ServerSent []node.PacketIO ServerRcvd []node.PacketIO // statistics Up packetStats // stats from client to server Down packetStats // stats from server to client RTT []rtt RTTMean float64 }
PacketAnalysis contains the data and calculated stats for a packet flow.
func (*PacketAnalysis) T0 ¶ added in v0.5.0
func (y *PacketAnalysis) T0() time.Time
T0 returns the earliest absolute packet time.
type RegexFilter ¶
RegexFilter is a TestFilter that matches Tests by their ID using regular expressions. If any of a Test ID's key/value pairs match the non-nil expressions in Key and Value, the Test is accepted. If both Key and Value are nil (i.e. a zero value RegexFilter), all Tests are accepted.
func NewRegexFilterArg ¶
func NewRegexFilterArg(arg string) (flt *RegexFilter, err error)
NewRegexFilterArg returns a new RegexFilter from a string argument. The argument may be either a single pattern matching the value of any ID field, or a string in the form key=value, where key and value are separate patterns that must match both a Test ID key and value for it to be accepted.
func (*RegexFilter) Accept ¶
func (f *RegexFilter) Accept(test *Test) bool
Accept implements TestFilter
type ReportCommand ¶
type ReportCommand struct { // DataFileUnset is called when a report was skipped because the Test's // DataFile field is empty. DataFileUnset func(test *Test) // NotFound is called when a report was skipped because the data file needed // to run it doesn't exist. NotFound func(test *Test, name string) // Reporting is called when a report starts running. Reporting func(test *Test) // Done is called when the ReportCommand is done. Done func(ReportInfo) }
ReportCommand runs the After reports using the data files as the source.
type ReportInfo ¶ added in v0.4.0
ReportInfo contains stats and info for a report run.
type ResultInfo ¶ added in v0.4.0
type ResultInfo struct { Name string // base name of result directory Path string // path to result directory }
ResultInfo contains information on one result.
type ResultReader ¶ added in v0.4.0
type ResultReader struct { // Name is the name of the result file as requested. This is not the name of // a file on the filesystem. Name string // Path is the path to the result file actually read, which may be either an // encoded or unencoded version of the file. Path string // Codec is the Codec used to decode the file. The zero value of Codec means // the file is read directly. Codec Codec // ReadCloser reads the result file, decoding it transparently if needed. io.ReadCloser }
ResultReader reads a result file.
type ResultWriter ¶ added in v0.4.0
type ResultWriter struct { // Name is the name of the result file as requested. This does not // correspond to the name of a file on the filesystem. Name string // Path is the path to the result file actually written, including WorkDir // and the result prefix. Path string // Codec is the Codec used to encode the file (based on Name's extension). // The zero value of Codec means the file is written directly. Codec Codec // WriteCloser writes the result file, encoding it transparently if needed. io.WriteCloser // contains filtered or unexported fields }
ResultWriter writes a result file.
type Results ¶ added in v0.4.0
type Results struct { RootDir string WorkDir string ResultDirUTC bool ResultDirFormat string LatestSymlink string Codec Codecs }
Results configures the behavior for reading and writing result files, which include all output files and reports.
Callers must use the open method to obtain a resultRW to read and write results in WorkDir. See the doc on resultRW for more info.
type RunCommand ¶
type RunCommand struct { // Filter selects which Tests to run. If Filter is nil, Tests which were not // run before or had errors are run. Filter TestFilter // Skipped is called when a Test was skipped because it wasn't accepted by // the Filter. Skipped func(*Test) // ReRunning is called when a Test is being re-run because the prior result // contains errors. ReRunning func(*Test) // Linked is called when Test data was linked from a prior run. Linked func(*Test) // Running is called when a Test starts running. Running func(*Test) // Done is called when the RunCommand is done. Done func(RunInfo) }
RunCommand runs tests and reports.
type RunInfo ¶ added in v0.4.0
type RunInfo struct { sync.Mutex Start time.Time Elapsed time.Duration Ran int Linked int ResultDir string }
RunInfo contains stats and info for a test run.
type SaveFiles ¶
type SaveFiles struct {
Consume bool
}
SaveFiles is a reporter that saves FileData. If Consume is true, FileData items are not forwarded to the out channel.
type ServerCommand ¶ added in v0.4.0
type ServerCommand struct { }
ServerCommand runs the builtin web server.
type StreamAnalysis ¶ added in v0.5.0
type StreamAnalysis struct { Flow node.Flow Client node.StreamInfo Server node.StreamInfo Sent []node.StreamIO Rcvd []node.StreamIO TCPInfo []node.TCPInfo GoodputPoint []GoodputPoint RtxCumAvg []rtxCumAvg FCT metric.Duration Length metric.Bytes SSExitTime metric.RelativeTime }
StreamAnalysis contains the data and calculated stats for a stream.
func (*StreamAnalysis) Goodput ¶ added in v0.5.0
func (s *StreamAnalysis) Goodput() metric.Bitrate
Goodput returns the total goodput for the stream.
func (*StreamAnalysis) T0 ¶ added in v0.5.0
func (s *StreamAnalysis) T0() time.Time
T0 returns the earliest absolute time from Sent or Rcvd.
type Test ¶
type Test struct { // ID uniquely identifies the Test in the test package. ID TestID // Path is the path prefix for result files. Path string // DataFile is the name of the gob file containing the raw result data. If // empty, raw result data is not saved for the Test. DataFile string // HMAC, if true, indicates that all nodes participating in this Test use // HMAC signing, to protect the servers from unauthorized use. HMAC bool // Run is the top-level Run instance. node.Run // Timeout is the maximum amount of time the Test can run for. Timeout metric.Duration // DuringDefault is the first part of a pipeline of Reports run while the // Test runs. DuringDefault Report // During is the latter part of a pipeline of Reports run while the Test // Runs. During Report // AfterDefault is the first part of a pipeline of Reports run while the // Test runs. AfterDefault Report // After is the latter part of a pipeline of Reports run while the Test // Runs. After Report }
Test is an Antler test.
func (*Test) DataHasError ¶ added in v0.4.0
DataHasError returns true if the DataFile exists and has errors. See DataReader for the errors that may be returned.
func (*Test) DataReader ¶
func (t *Test) DataReader(rw resultRW) (rc io.ReadCloser, err error)
DataReader returns a ReadCloser for reading result data.
If DataFile is empty, DataFileUnsetError is returned.
If the data file does not exist, errors.Is(err, fs.ErrNotExist) returns true.
func (*Test) DataWriter ¶
func (t *Test) DataWriter(rw resultRW) (wc io.WriteCloser, err error)
DataWriter returns a WriteCloser for writing result data to the work directory.
If DataFile is empty, DataFileUnsetError is returned.
func (*Test) LinkPriorData ¶ added in v0.4.0
LinkPriorData creates hard links to the most recent result data for this Test. DataFile is linked, along with any FileRefs it contains.
If DataFile is empty, DataFileUnsetError is returned.
If no prior result data for this Test could be found, LinkError is returned.
type TestFilter ¶
A TestFilter accepts or rejects Tests.
type TestID ¶
TestID represents a compound Test identifier. Keys and values must match the regex defined in config.cue.
func (TestID) Equal ¶
Equal returns true if other is equal to this TestID (they contain the same key/value pairs).
type UnionError ¶ added in v0.7.1
UnionError is returned when a union type doesn't have exactly one field set. NOTE Keep in sync with parallel type in node package.