apispec

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Whether to send TCP and TLS reports to the back end.
	//
	// Invariant: if this is true, then so is DefaultParseTLSHandshakes.
	DefaultCollectTCPAndTLSReports = false

	// The name of the deployment.
	DefaultDeployment = "default"

	// The maximum witness size. Any witnesses larger than this are dropped.
	DefaultMaxWitnessSize_bytes = 30_000_000 // 30 MB

	// Whether to enable parsing of TLS handshakes.
	//
	// Invariant: if this is false, then so is DefaultCollectTCPAndTLSReports.
	DefaultParseTLSHandshakes = true

	// How many requests to capture per minute.
	DefaultRateLimit = 1000.0

	// How long to wait after starting up before printing packet-capture statistics.
	DefaultStatsLogDelay_seconds = 60

	// How often to upload client telemetry.
	DefaultTelemetryInterval_seconds = 5 * 60 // 5 minutes

	// How often to upload client telemetry.
	DefaultProcFSPollingInterval_seconds = 5 * 60 // 5 minutes

	// How often to rotate traces in the back end.
	DefaultTraceRotateInterval = time.Hour
)

Specifies default values for command-line parameters.

These really ought to live in apidump, but that package depends on libpcap. So we put these constants here to avoid pulling in libpcap when importing these constants.

Variables

This section is empty.

Functions

func ParseFromHAR added in v0.21.2

func ParseFromHAR(col trace.Collector, log *hl.CustomHARLog) (int, sampled_err.Errors)

Returns the number of entries successfully collected from the given HAR log.

func ProcessHAR added in v0.12.0

func ProcessHAR(col trace.Collector, p string) (int, error)

Extract witnesses from a local HAR file and send them to the collector. Returns the number of entries extracted.

func ProcessHAREntry added in v0.12.0

func ProcessHAREntry(col trace.Collector, harUUID uuid.UUID, seqNum int, entry hl.CustomHAREntry, errs *sampled_err.Errors) bool

Processes a single entry from a HAR file. The UUID identifies the HAR file, whereas the seqNum identifies the entry within the file.

If any errors occur, the given Errors is updated, and false is returned. Otherwise, true is returned on success.

func WriteSpec added in v0.17.0

func WriteSpec(out io.Writer, spec string) error

Types

type ReconstructedTimestamps added in v0.12.0

type ReconstructedTimestamps struct {
	RequestStart  time.Time
	RequestEnd    time.Time
	ResponseStart time.Time
	ResponseEnd   time.Time
}

ReconstructedTimestamps holds times we can use to fill in a ParsedNetworkTraffic, in such a way that the reported latencies in the Witness will end up the same as in the HAR file. (Because I couldn't think of a good way to pass the measurements through the to two separate Process calls, without major refactoring.)

In the future, we could save these timestamps directly in a custom field, or pass the interval values through.

Jump to

Keyboard shortcuts

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