apispec

package
v0.22.1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2022 License: Apache-2.0 Imports: 38 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.

Variables

This section is empty.

Functions

func GetSpecURL added in v0.12.0

func GetSpecURL(domain string, svc akid.ServiceID, spec akid.APISpecID) url.URL

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 Run

func Run(args Args) error

func WriteSpec added in v0.17.0

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

Types

type Args

type Args struct {
	// Required
	ClientID akid.ClientID
	Domain   string
	Traces   []location.Location

	// If unset, defaults to a randomly generated backend learn session.
	Out location.Location

	Service                    string
	Format                     string
	Tags                       map[tags.Key]string
	Versions                   []string
	GetSpecEnableRelatedFields bool
	IncludeTrackers            bool
	PathParams                 []string
	PathExclusions             []string
	Timeout                    *time.Duration
	TimeRange                  *time_span.TimeSpan

	GitHubBranch string
	GitHubCommit string
	GitHubRepo   string
	GitHubPR     int

	GitLabMR *gitlab.MRInfo

	Plugins []plugin.AkitaPlugin

	// Legacy -- used by `akita learn-sessions checkpoint`.
	LearnSessionID *akid.LearnSessionID
}

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