collect

package
v0.1.29 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 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 collect task inputs
	DefaultQPS float32 = 8

	// DefaultTime is the default value of time (duration of queries) in collect task inputs
	DefaultTime string = "5s"
)

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 long to run the metrics collector; optional; default 5s
	Time *string `json:"time,omitempty" yaml:"time,omitempty"`
	// list of versions
	Versions []Version `json:"versions" yaml:"versions"`
	// URL of the JSON file to send during the query; optional
	PayloadURL *string `json:"payloadURL,omitempty" yaml:"payloadURL,omitempty"`
	// if LoadOnly is set to true, this task will send requests without collecting metrics; optional
	LoadOnly *bool `json:"loadOnly,omitempty" yaml:"loadOnly,omitempty"`
}

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 time duration and QPS for Fortio run Default values are set only if the field is non-empty

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"`
	// how many queries per second will be sent to this version; optional; default 8
	QPS *float32 `json:"qps,omitempty" yaml:"qps,omitempty"`
	// 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