parser

package
v2.4.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2020 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Overview

Package parser defines the Parser interface and implementations for the different test types, NDT, Paris Traceroute, and SideStream.

Package parser defines the Parser interface and implementations for the different test types, NDT, Paris Traceroute, and SideStream.

Index

Constants

View Source
const (
	// These are all caps to reflect the linux constant names.
	WC_ADDRTYPE_IPV4 = 1
	WC_ADDRTYPE_IPV6 = 2
	LOCAL_AF_IPV4    = 0
	LOCAL_AF_IPV6    = 1
)
View Source
const (
	CLIENT_TO_SERVER = 0
	SERVER_TO_CLIENT = 1
)
View Source
const IPv4_AF int32 = 2
View Source
const IPv6_AF int32 = 10
View Source
const PTBufferSize int = 2

Variables

View Source
var (
	ErrAnnotationError = errors.New("Annotation error")
	ErrNotAnnotatable  = errors.New("object does not implement Annotatable")
	ErrRowNotPointer   = errors.New("Row should be a pointer type")
)

Errors that may be returned by BaseRowBuffer functions.

View Source
var (
	// NDTOmitDeltas flag indicates if deltas should be suppressed.
	NDTOmitDeltas, _ = strconv.ParseBool(os.Getenv("NDT_OMIT_DELTAS"))
	// NDTEstimateBW flag indicates if we should run BW estimation code
	// and annotate rows.
	NDTEstimateBW, _ = strconv.ParseBool(os.Getenv("NDT_ESTIMATE_BW"))
)

Functions

func CopyStructToMap

func CopyStructToMap(sourceStruct interface{}, destinationMap map[string]bigquery.Value)

CopyStructToMap takes a POINTER to an arbitrary SIMPLE struct and copies it's fields into a value map. It will also make fields entirely lower case, for convienece when working with exported structs. Also, NEVER pass in something that is not a pointer to a struct, as this will cause a panic.

func CreateTestId

func CreateTestId(fn string, bn string) string

func ExtractLogtimeFromFilename

func ExtractLogtimeFromFilename(fileName string) (time.Time, error)

ExtractLogtimeFromFilename extracts the log time. legacy filename is like "20170203T00:00:00Z_ALL0.web100" The current filename is like "20170315T01:00:00Z_173.205.3.39_0.web100" Return time stamp if the filename is in right format

func GetLogtime

func GetLogtime(filename PTFileName) (time.Time, error)

Return timestamp parsed from file name.

func NewAnnotationParser

func NewAnnotationParser(sink row.Sink, label, suffix string, ann v2as.Annotator) etl.Parser

NewAnnotationParser creates a new parser for annotation data.

func NewDiscoParser

func NewDiscoParser(ins etl.Inserter) etl.Parser

func NewNDT5ResultParser

func NewNDT5ResultParser(sink row.Sink, label, suffix string, ann v2as.Annotator) etl.Parser

NewNDT5ResultParser returns a parser for NDT5Result archives.

func NewNDT7ResultParser

func NewNDT7ResultParser(sink row.Sink, table, suffix string, ann v2as.Annotator) etl.Parser

NewNDT7ResultParser returns a parser for NDT7Result archives.

func NewParser

func NewParser(dt etl.DataType, ins etl.Inserter) etl.Parser

NewParser creates an appropriate parser for a given data type. DEPRECATED - parsers should migrate to use NewSinkParser.

func NewSinkParser

func NewSinkParser(dt etl.DataType, sink row.Sink, table string, ann api.Annotator) etl.Parser

NewSinkParser creates an appropriate parser for a given data type. Eventually all datatypes will use this instead of NewParser.

func PackDataIntoSchema

func PackDataIntoSchema(ssValue map[string]string, logTime time.Time, testName string) (schema.SS, error)

PackDataIntoSchema packs data into sidestream BigQeury schema and buffers it.

func Parse

func Parse(meta map[string]bigquery.Value, testName string, testId string, rawContent []byte, tableName string) (cachedPTData, error)

Parse the raw test file into hops ParisTracerouteHop. TODO(dev): dedup the hops that are identical.

func ParseFirstLine

func ParseFirstLine(oneLine string) (protocol string, destIP string, serverIP string, err error)

Handle the first line, like "traceroute [(64.86.132.76:33461) -> (98.162.212.214:53849)], protocol icmp, algo exhaustive, duration 19 s"

func ParseJSON

func ParseJSON(testName string, rawContent []byte, tableName string, taskFilename string) (schema.PTTest, error)

ParseJSON the raw jsonl test file into schema.PTTest.

func ParseKHeader

func ParseKHeader(header string) ([]string, error)

ParseKHeader parses the first line of SS file, in format "K: cid PollTime LocalAddress LocalPort ... other_web100_variables_separated_by_space"

func ParseOneLine

func ParseOneLine(snapshot string, varNames []string) (map[string]string, error)

ParseOneLine parses a single line of sidestream data.

func ParsePT

func ParsePT(testName string, rawContent []byte, tableName string, taskFilename string) (schema.PTTest, error)

ParsonPT the json test file into schema.PTTest

func PopulateSnap

func PopulateSnap(ssValue map[string]string) (schema.Web100Snap, error)

PopulateSnap fills in the snapshot data.

func ProcessAllNodes

func ProcessAllNodes(allNodes []Node, server_IP, protocol string, tableName string) []schema.ScamperHop

ProcessAllNodes take the array of the Nodes, and generate one ScamperHop entry from each node.

func ProcessOneTuple

func ProcessOneTuple(parts []string, protocol string, currentLeaves []Node, allNodes, newLeaves *[]Node) error

For each 4 tuples, it is like: parts[0] is the hostname, like "if-ae-10-3.tcore2.DT8-Dallas.as6453.net". parts[1] is IP address like "(66.110.57.41)" or "(72.14.218.190):0,2,3,4,6,8,10" parts[2] are rtt in numbers like "0.298/0.318/0.340/0.016" parts[3] should always be "ms"

func Unique

func Unique(oneNode Node, list []Node) bool

This function was designed for hops with multiple flows. When the source IP are duplicate flows, but the destination IP is single flow IP, those hops will result in just one node in the list.

func Version

func Version() string

Version returns the parser version used by parsers to annotate data rows.

Types

type AnnotationParser

type AnnotationParser struct {
	*row.Base
	// contains filtered or unexported fields
}

AnnotationParser parses the annotation datatype from the uuid-annotator.

func (*AnnotationParser) Accepted

func (ap *AnnotationParser) Accepted() int

Accepted returns the count of all rows received through InsertRow(s)

func (*AnnotationParser) Committed

func (ap *AnnotationParser) Committed() int

Committed returns the count of rows successfully committed to BQ.

func (*AnnotationParser) Failed

func (ap *AnnotationParser) Failed() int

Failed returns the count of all rows that could not be committed.

func (*AnnotationParser) Flush

func (ap *AnnotationParser) Flush() error

func (*AnnotationParser) FullTableName

func (ap *AnnotationParser) FullTableName() string

func (*AnnotationParser) IsParsable

func (ap *AnnotationParser) IsParsable(testName string, data []byte) (string, bool)

IsParsable returns the canonical test type and whether to parse data.

func (*AnnotationParser) ParseAndInsert

func (ap *AnnotationParser) ParseAndInsert(meta map[string]bigquery.Value, testName string, test []byte) error

ParseAndInsert decodes the data.Annotation JSON and inserts it into BQ.

func (*AnnotationParser) RowsInBuffer

func (ap *AnnotationParser) RowsInBuffer() int

RowsInBuffer returns the count of rows currently in the buffer.

func (*AnnotationParser) TableName

func (ap *AnnotationParser) TableName() string

func (*AnnotationParser) TaskError

func (ap *AnnotationParser) TaskError() error

TaskError returns non-nil if the task had enough failures to justify recording the entire task as in error. For now, this is any failure rate exceeding 10%.

type Base

type Base struct {
	etl.Inserter
	RowBuffer
}

Base provides common parser functionality.

func NewBase

func NewBase(ins etl.Inserter, bufSize int, ann v2as.Annotator) *Base

NewBase creates a new parser.Base. This will generally be embedded in a type specific parser.

func (*Base) AnnotateAndFlush

func (pb *Base) AnnotateAndFlush(metricLabel string) error

AnnotateAndFlush annotates the rows in the buffer, and synchronously pushes them through Inserter.

func (*Base) AnnotateAndPutAsync

func (pb *Base) AnnotateAndPutAsync(metricLabel string) error

AnnotateAndPutAsync annotates the rows in the buffer (synchronously), and asynchronously pushes them to the Inserter.

func (*Base) Flush

func (pb *Base) Flush() error

Flush synchronously flushes any pending rows. Caller should generally call Annotate first, or use AnnotateAndFlush.

func (*Base) TaskError

func (pb *Base) TaskError() error

TaskError return the task level error, based on failed rows, or any other criteria.

type CyclestartLine

type CyclestartLine struct {
	Type       string  `json:"type"`
	List_name  string  `json:"list_name"`
	ID         float64 `json:"id"`
	Hostname   string  `json:"hostname"`
	Start_time float64 `json:"start_time"`
}

type CyclestopLine

type CyclestopLine struct {
	Type      string  `json:"type"`
	List_name string  `json:"list_name"`
	ID        float64 `json:"id"`
	Hostname  string  `json:"hostname"`
	Stop_time float64 `json:"stop_time"`
}

type DiscoParser

type DiscoParser struct {
	etl.RowStats // RowStats implemented for DiscoParser with an embedded struct.
	// contains filtered or unexported fields
}

TODO(dev) add tests

func (*DiscoParser) Flush

func (dp *DiscoParser) Flush() error

These functions are also required to complete the etl.Parser interface. For Disco, we just forward the calls to the Inserter.

func (*DiscoParser) FullTableName

func (dp *DiscoParser) FullTableName() string

func (*DiscoParser) IsParsable

func (dp *DiscoParser) IsParsable(testName string, data []byte) (string, bool)

IsParsable returns the canonical test type and whether to parse data.

func (*DiscoParser) ParseAndInsert

func (dp *DiscoParser) ParseAndInsert(meta map[string]bigquery.Value, testName string, test []byte) error

Disco data a JSON representation that should be pushed directly into BigQuery. For now, though, we parse into a struct, for compatibility with current inserter backend.

Returns:

error on Decode error
error on InsertRows error
nil on success

TODO - optimize this to use the JSON directly, if possible.

func (*DiscoParser) TableName

func (dp *DiscoParser) TableName() string

func (*DiscoParser) TaskError

func (dp *DiscoParser) TaskError() error

type FakeRowStats

type FakeRowStats struct {
}

FakeRowStats provides trivial implementation of RowStats interface.

func (*FakeRowStats) Accepted

func (s *FakeRowStats) Accepted() int

func (*FakeRowStats) Committed

func (s *FakeRowStats) Committed() int

func (*FakeRowStats) Failed

func (s *FakeRowStats) Failed() int

func (*FakeRowStats) RowsInBuffer

func (s *FakeRowStats) RowsInBuffer() int

type MetaFileData

type MetaFileData struct {
	TestName    string
	DateTime    time.Time
	SummaryData []int32 // Note: this is ignored in the legacy pipeline.
	Tls         bool
	Websockets  bool

	Fields map[string]string // All of the string fields.
}

MetaFileData is the parsed info from the .meta file.

func ProcessMetaFile

func ProcessMetaFile(tableName string, suffix string, testName string, content []byte) *MetaFileData

ProcessMetaFile parses the .meta file. TODO(dev) - add unit tests TODO(prod) - For tests that include a meta file, should respect the test filenames. See ndt_meta_log_parser_lib.cc

func (*MetaFileData) PopulateConnSpec

func (mfd *MetaFileData) PopulateConnSpec(connSpec schema.Web100ValueMap)

type Metadata

type Metadata struct {
	UUID                    string
	TracerouteCallerVersion string
	CachedResult            bool
	CachedUUID              string
}

type NDT5ResultParser

type NDT5ResultParser struct {
	*row.Base
	// contains filtered or unexported fields
}

NDT5ResultParser handles parsing of NDT5Result archives.

func (*NDT5ResultParser) Accepted

func (dp *NDT5ResultParser) Accepted() int

Accepted returns the count of all rows received through InsertRow(s)

func (*NDT5ResultParser) Committed

func (dp *NDT5ResultParser) Committed() int

Committed returns the count of rows successfully committed to BQ.

func (*NDT5ResultParser) Failed

func (dp *NDT5ResultParser) Failed() int

Failed returns the count of all rows that could not be committed.

func (*NDT5ResultParser) Flush

func (dp *NDT5ResultParser) Flush() error

func (*NDT5ResultParser) FullTableName

func (dp *NDT5ResultParser) FullTableName() string

func (*NDT5ResultParser) IsParsable

func (dp *NDT5ResultParser) IsParsable(testName string, data []byte) (string, bool)

IsParsable returns the canonical test type and whether to parse data.

func (*NDT5ResultParser) ParseAndInsert

func (dp *NDT5ResultParser) ParseAndInsert(meta map[string]bigquery.Value, testName string, test []byte) error

ParseAndInsert decodes the data.NDT5Result JSON and inserts it into BQ.

func (*NDT5ResultParser) RowsInBuffer

func (dp *NDT5ResultParser) RowsInBuffer() int

RowsInBuffer returns the count of rows currently in the buffer.

func (*NDT5ResultParser) TableName

func (dp *NDT5ResultParser) TableName() string

func (*NDT5ResultParser) TaskError

func (dp *NDT5ResultParser) TaskError() error

TaskError returns non-nil if the task had enough failures to justify recording the entire task as in error. For now, this is any failure rate exceeding 10%.

type NDT7ResultParser

type NDT7ResultParser struct {
	*row.Base
	// contains filtered or unexported fields
}

NDT7ResultParser handles parsing of NDT7Result archives.

func (*NDT7ResultParser) Accepted

func (dp *NDT7ResultParser) Accepted() int

Accepted returns the count of all rows received through InsertRow(s)

func (*NDT7ResultParser) Committed

func (dp *NDT7ResultParser) Committed() int

Committed returns the count of rows successfully committed to BQ.

func (*NDT7ResultParser) Failed

func (dp *NDT7ResultParser) Failed() int

Failed returns the count of all rows that could not be committed.

func (*NDT7ResultParser) Flush

func (dp *NDT7ResultParser) Flush() error

func (*NDT7ResultParser) FullTableName

func (dp *NDT7ResultParser) FullTableName() string

func (*NDT7ResultParser) IsParsable

func (dp *NDT7ResultParser) IsParsable(testName string, data []byte) (string, bool)

IsParsable returns the canonical test type and whether to parse data.

func (*NDT7ResultParser) ParseAndInsert

func (dp *NDT7ResultParser) ParseAndInsert(meta map[string]bigquery.Value, testName string, test []byte) error

ParseAndInsert decodes the data.NDT7Result JSON and inserts it into BQ.

func (*NDT7ResultParser) RowsInBuffer

func (dp *NDT7ResultParser) RowsInBuffer() int

RowsInBuffer returns the count of rows currently in the buffer.

func (*NDT7ResultParser) TableName

func (dp *NDT7ResultParser) TableName() string

func (*NDT7ResultParser) TaskError

func (dp *NDT7ResultParser) TaskError() error

TaskError returns non-nil if the task had enough failures to justify recording the entire task as in error. For now, this is any failure rate exceeding 10%.

type NDTParser

type NDTParser struct {
	Base
	// contains filtered or unexported fields
}

NDTParser implements the Parser interface for NDT.

func NewNDTParser

func NewNDTParser(ins etl.Inserter, annotator ...v2as.Annotator) *NDTParser

NewNDTParser returns a new NDT parser. Caller may include an annotator. If not provided, the default annotator is used. TODO - clean up the vararg annotator hack once it is standard in all parsers.

func (*NDTParser) Flush

func (n *NDTParser) Flush() error

Flush completes processing of final task group, if any, and flushes buffer to BigQuery.

func (*NDTParser) IsParsable

func (n *NDTParser) IsParsable(testName string, data []byte) (string, bool)

IsParsable returns the canonical test type and whether to parse data.

func (*NDTParser) ParseAndInsert

func (n *NDTParser) ParseAndInsert(taskInfo map[string]bigquery.Value, testName string, content []byte) error

ParseAndInsert extracts the last snaplog from the given raw snap log.

func (*NDTParser) TableName

func (n *NDTParser) TableName() string

TableName returns the base of the bq table inserter target.

func (*NDTParser) TaskError

func (n *NDTParser) TaskError() error

TaskError returns non-nil if more than 10% of row inserts failed.

type NDTTest

type NDTTest struct {
	schema.Web100ValueMap
}

NDTTest is a wrapper for Web100ValueMap that implements Annotatable.

func (NDTTest) AnnotateClients

func (ndt NDTTest) AnnotateClients(annMap map[string]*api.Annotations) error

AnnotateClients adds the client annotations. See parser.Annotatable This is a bit ugly because of the use of bigquery Value maps.

func (NDTTest) AnnotateServer

func (ndt NDTTest) AnnotateServer(local *api.Annotations) error

AnnotateServer adds the server annotations. See parser.Annotatable This is a bit ugly because of the use of bigquery Value maps.

func (NDTTest) GetClientIPs

func (ndt NDTTest) GetClientIPs() []string

GetClientIPs returns the client (remote) IP for annotation. See parser.Annotatable This is a bit ugly because of the use of bigquery Value maps.

func (NDTTest) GetLogTime

func (ndt NDTTest) GetLogTime() time.Time

GetLogTime returns the timestamp that should be used for annotation.

func (NDTTest) GetServerIP

func (ndt NDTTest) GetServerIP() string

GetServerIP returns the server (local) IP for annotation. See parser.Annotatable This is a bit ugly because of the use of bigquery Value maps.

type Node

type Node struct {
	// contains filtered or unexported fields
}

type NullParser

type NullParser struct {
	FakeRowStats
}

func (*NullParser) ParseAndInsert

func (np *NullParser) ParseAndInsert(meta map[string]bigquery.Value, testName string, test []byte) error

func (*NullParser) TableName

func (np *NullParser) TableName() string

func (*NullParser) TaskError

func (np *NullParser) TaskError() error

type PTFileName

type PTFileName struct {
	Name string
}

------------------------------------------------- The following are struct and funcs shared by legacy parsing and Json parsing. -------------------------------------------------

func (*PTFileName) GetDate

func (f *PTFileName) GetDate() (string, bool)

type PTParser

type PTParser struct {
	Base
	// contains filtered or unexported fields
}

func NewPTParser

func NewPTParser(ins etl.Inserter, ann ...v2as.Annotator) *PTParser

func (*PTParser) Flush

func (pt *PTParser) Flush() error

func (*PTParser) InsertOneTest

func (pt *PTParser) InsertOneTest(oneTest cachedPTData)

func (*PTParser) IsParsable

func (pt *PTParser) IsParsable(testName string, data []byte) (string, bool)

IsParsable returns the canonical test type and whether to parse data.

func (*PTParser) NumBufferedTests

func (pt *PTParser) NumBufferedTests() int

func (*PTParser) ParseAndInsert

func (pt *PTParser) ParseAndInsert(meta map[string]bigquery.Value, testName string, rawContent []byte) error

ParseAndInsert parses a paris-traceroute log file and inserts results into a single row.

func (*PTParser) ProcessLastTests

func (pt *PTParser) ProcessLastTests() error

Insert last several tests in previousTests

func (*PTParser) TableName

func (pt *PTParser) TableName() string

func (*PTParser) TaskError

func (pt *PTParser) TaskError() error

type Probe

type Probe struct {
	Tx      TS      `json:"tx"`
	Replyc  int     `json:"replyc"`
	Ttl     int64   `json:"ttl"`
	Attempt int     `json:"attempt"`
	Flowid  int64   `json:"flowid"`
	Replies []Reply `json:"replies"`
}

type Reply

type Reply struct {
	Rx         TS      `json:"rx"`
	Ttl        int     `json:"ttl"`
	Rtt        float64 `json:"rtt"`
	Icmp_type  int     `json:"icmp_type"`
	Icmp_code  int     `json:"icmp_code"`
	Icmp_q_tos int     `json:"icmp_q_tos"`
	Icmp_q_ttl int     `json:"icmp_q_ttl"`
}

type RowBuffer

type RowBuffer struct {
	// contains filtered or unexported fields
}

RowBuffer provides all basic functionality generally needed for buffering, annotating, and inserting rows that implement Annotatable.

func (*RowBuffer) AddRow

func (buf *RowBuffer) AddRow(r interface{}) error

AddRow simply inserts a row into the buffer. Returns error if buffer is full. Not thread-safe. Should only be called by owning thread.

func (*RowBuffer) Annotate

func (buf *RowBuffer) Annotate(metricLabel string) error

Annotate fetches annotations for all rows in the buffer. Not thread-safe. Should only be called by owning thread. TODO should convert this to operate on the rows, instead of the buffer. Then we can do it after TakeRows().

func (*RowBuffer) NumRowsForTest

func (buf *RowBuffer) NumRowsForTest() int

NumRowsForTest allows tests to find number of rows in buffer.

func (*RowBuffer) TakeRows

func (buf *RowBuffer) TakeRows() []interface{}

TakeRows returns all rows in the buffer, and clears the buffer. Not thread-safe. Should only be called by owning thread.

type SSParser

type SSParser struct {
	Base
}

SSParser provides a parser implementation for SideStream data.

func NewDefaultSSParser

func NewDefaultSSParser(ins etl.Inserter) *SSParser

TODO get rid of this hack.

func NewSSParser

func NewSSParser(ins etl.Inserter, ann v2as.Annotator) *SSParser

NewSSParser creates a new sidestream parser.

func (*SSParser) IsParsable

func (ss *SSParser) IsParsable(testName string, data []byte) (string, bool)

IsParsable returns the canonical test type and whether to parse data.

func (*SSParser) ParseAndInsert

func (ss *SSParser) ParseAndInsert(meta map[string]bigquery.Value, testName string, rawContent []byte) error

ParseAndInsert extracts each sidestream record from the rawContent and inserts each into a separate row.

func (*SSParser) TableName

func (ss *SSParser) TableName() string

TableName of the table that this Parser inserts into.

type ScamperLink struct {
	Addr   string  `json:"addr"`
	Probes []Probe `json:"probes"`
}

type ScamperNode

type ScamperNode struct {
	Addr  string          `json:"addr"`
	Name  string          `json:"name"`
	Q_ttl int             `json:"q_ttl"`
	Linkc int64           `json:"linkc"`
	Links [][]ScamperLink `json:"links"`
}

type TCPInfoParser

type TCPInfoParser struct {
	*row.Base
	// contains filtered or unexported fields
}

TCPInfoParser handles parsing for TCPINFO datatype.

func NewTCPInfoParser

func NewTCPInfoParser(sink row.Sink, table, suffix string, ann v2as.Annotator) *TCPInfoParser

NewTCPInfoParser creates a new TCPInfoParser. Duh. Annotator may be optionally passed in, or will be created if nil.

func (*TCPInfoParser) Accepted

func (p *TCPInfoParser) Accepted() int

Accepted returns the count of all rows received through InsertRow(s)

func (*TCPInfoParser) Committed

func (p *TCPInfoParser) Committed() int

Committed returns the count of rows successfully committed to BQ.

func (*TCPInfoParser) Failed

func (p *TCPInfoParser) Failed() int

Failed returns the count of all rows that could not be committed.

func (*TCPInfoParser) Flush

func (p *TCPInfoParser) Flush() error

Flush synchronously flushes any pending rows.

func (*TCPInfoParser) FullTableName

func (p *TCPInfoParser) FullTableName() string

FullTableName implements etl.Parser.FullTableName

func (*TCPInfoParser) IsParsable

func (p *TCPInfoParser) IsParsable(testName string, data []byte) (string, bool)

IsParsable returns the canonical test type and whether to parse data.

func (*TCPInfoParser) ParseAndInsert

func (p *TCPInfoParser) ParseAndInsert(fileMetadata map[string]bigquery.Value, testName string, rawContent []byte) error

ParseAndInsert extracts all ArchivalRecords from the rawContent and inserts into a single row. Approximately 15 usec/snapshot.

func (*TCPInfoParser) RowsInBuffer

func (p *TCPInfoParser) RowsInBuffer() int

RowsInBuffer returns the count of rows currently in the buffer.

func (*TCPInfoParser) TableName

func (p *TCPInfoParser) TableName() string

TableName implements etl.Parser.TableName

func (*TCPInfoParser) TaskError

func (p *TCPInfoParser) TaskError() error

TaskError return the task level error, based on failed rows, or any other criteria. TaskError returns non-nil if more than 10% of row commits failed.

type TS

type TS struct {
	Sec  int64 `json:"sec"`
	Usec int64 `json:"usec"`
}

type TestInfo

type TestInfo struct {
	DateDir   string    // Optional leading date yyyy/mm/dd/
	Date      string    // The date field from the test file name
	Time      string    // The time field
	Address   string    // The remote address field
	Suffix    string    // The filename suffix
	Timestamp time.Time // The parsed timestamp, with microsecond resolution
}

TestInfo contains all the fields from a valid NDT test file name.

func ParseNDTFileName

func ParseNDTFileName(path string) (*TestInfo, error)

ParseNDTFileName parses the name of a tar or tgz file containing NDT test data.

type TracelbLine

type TracelbLine struct {
	Type         string        `json:"type"`
	Version      string        `json:"version"`
	Userid       float64       `json:"userid"`
	Method       string        `json:"method"`
	Src          string        `json:"src"`
	Dst          string        `json:"dst"`
	Start        TS            `json:"start"`
	Probe_size   float64       `json:"probe_size"`
	Firsthop     float64       `json:"firsthop"`
	Attempts     float64       `json:"attempts"`
	Confidence   float64       `json:"confidence"`
	Tos          float64       `json:"tos"`
	Gaplint      float64       `json:"gaplint"`
	Wait_timeout float64       `json:"wait_timeout"`
	Wait_probe   float64       `json:"wait_probe"`
	Probec       float64       `json:"probec"`
	Probec_max   float64       `json:"probec_max"`
	Nodec        float64       `json:"nodec"`
	Linkc        float64       `json:"linkc"`
	Nodes        []ScamperNode `json:"nodes"`
}

Jump to

Keyboard shortcuts

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