collect

package
v0.1.38 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TaskName is the name of the task this file implements
	TaskName string = "metrics/collect"

	// DefaultQPS is the default value of QPS (queries per sec) in the collect task
	DefaultQPS float32 = 8

	// DefaultNumQueries is the default value of the number of queries used by the collect task
	DefaultNumQueries uint32 = 100

	// DefaultConnections is the default value of the number of connections
	DefaultConnections uint32 = 4
)

Variables

This section is empty.

Functions

func Make

func Make(t *v2alpha2.TaskSpec) (core.Task, error)

Make constructs a CollectTask out of a collect task spec

Types

type CollectInputs

type CollectInputs struct {
	// how many queries will be sent for each version; optional; default 100
	NumQueries *uint32 `json:"numQueries,omitempty" yaml:"numQueries,omitempty"`
	// how long to run the metrics collector; optional;
	// if both time and numQueries are specified, numQueries takes precedence
	Time *string `json:"time,omitempty" yaml:"time,omitempty"`
	// how many queries per second will be sent; optional; default 8
	QPS *float32 `json:"qps,omitempty" yaml:"qps,omitempty"`
	// how many parallel connections will be used; optional; default 4
	Connections *uint32 `json:"connections,omitempty" yaml:"connections,omitempty"`
	// if LoadOnly is true, send requests without collecting metrics; optional; default false
	LoadOnly *bool `json:"loadOnly,omitempty" yaml:"loadOnly,omitempty"` // list of versions
	// string to be sent during queries as payload; optional
	PayloadStr *string `json:"payloadStr,omitempty" yaml:"payloadStr,omitempty"`
	// URL whose content will be sent as payload during queries; optional
	// if both payloadURL and payloadStr are specified, the URL takes precedence
	PayloadURL *string `json:"payloadURL,omitempty" yaml:"payloadURL,omitempty"`
	// valid HTTP content type string; specifying this switches the request from GET to POST
	ContentType *string `json:"contentType,omitempty" yaml:"contentType,omitempty"`
	// information about versions
	Versions []Version `json:"versions" yaml:"versions"`
}

CollectInputs contain the inputs to the metrics collection task to be executed.

type CollectTask

type CollectTask struct {
	core.TaskMeta
	With CollectInputs `json:"with" yaml:"with"`
}

CollectTask enables collection of Iter8's built-in metrics.

func (*CollectTask) InitializeDefaults

func (t *CollectTask) InitializeDefaults()

InitializeDefaults sets default values for the collect task

func (*CollectTask) Run

func (t *CollectTask) Run(ctx context.Context) error

Run executes the metrics/collect task ToDo: error handling

type DurationHist

type DurationHist struct {
	Count int
	Max   float64
	Sum   float64
	Data  []DurationSample
}

DurationHist is the Fortio duration histogram

type DurationSample

type DurationSample struct {
	Start float64
	End   float64
	Count int
}

DurationSample is a Fortio duration sample

type Result

type Result struct {
	DurationHistogram DurationHist
	RetCodes          map[string]int
}

Result is the result of a single Fortio run; it contains the result for a single version

type Version

type Version struct {
	// name of the version
	// version names must be unique and must match one of the version names in the
	// VersionInfo field of the experiment
	Name string `json:"name" yaml:"name"`
	// HTTP headers to use in the query for this version; optional
	Headers map[string]string `json:"headers,omitempty" yaml:"headers,omitempty"`
	// URL to use for querying this version
	URL string `json:"url" yaml:"url"`
}

Version contains header and url information needed to send requests to each version.

Jump to

Keyboard shortcuts

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