Documentation ¶
Index ¶
- Constants
- func New(params output.Params) (output.Output, error)
- type AggregatedMetric
- type AggregatedRate
- type Output
- func (out *Output) AddMetricSamples(sampleContainers []stats.SampleContainer)
- func (out *Output) Description() string
- func (out *Output) PushMetric(referenceID string, noCompress bool, s []*Sample) error
- func (out *Output) SetRunStatus(status lib.RunStatus)
- func (out *Output) SetThresholds(scriptThresholds map[string]stats.Thresholds)
- func (out *Output) Start() error
- func (out *Output) Stop() error
- type Sample
- type SampleDataAggregatedHTTPReqs
- type SampleDataMap
- type SampleDataSingle
Constants ¶
const ( DataTypeSingle = "Point" DataTypeMap = "Points" DataTypeAggregatedHTTPReqs = "AggregatedPoints" )
DataType constants
const TestName = "k6 test"
TestName is the default Load Impact Cloud test name
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AggregatedMetric ¶
type AggregatedMetric struct { // Updated by Calc() and used in the JSON output Min float64 `json:"min"` Max float64 `json:"max"` Avg float64 `json:"avg"` // contains filtered or unexported fields }
AggregatedMetric is used to store aggregated information for a particular metric in an SampleDataAggregatedMap.
func (*AggregatedMetric) Add ¶
func (am *AggregatedMetric) Add(t time.Duration)
Add the new duration to the internal sum and update Min and Max if necessary
func (*AggregatedMetric) Calc ¶
func (am *AggregatedMetric) Calc(count float64)
Calc populates the float fields for min and max and calculates the average value
type AggregatedRate ¶
AggregatedRate is an aggregation of a Rate metric
func (*AggregatedRate) Add ¶
func (ar *AggregatedRate) Add(b bool)
Add a boolean to the aggregated rate
func (AggregatedRate) IsDefined ¶
func (ar AggregatedRate) IsDefined() bool
IsDefined implements easyjson.Optional
type Output ¶
type Output struct {
// contains filtered or unexported fields
}
Output sends result data to the Load Impact cloud service.
func (*Output) AddMetricSamples ¶
func (out *Output) AddMetricSamples(sampleContainers []stats.SampleContainer)
AddMetricSamples receives a set of metric samples. This method is never called concurrently, so it defers as much of the work as possible to the asynchronous goroutines initialized in Start().
func (*Output) Description ¶
Description returns the URL with the test run results.
func (*Output) PushMetric ¶
PushMetric pushes the provided metric samples for the given referenceID
func (*Output) SetRunStatus ¶
SetRunStatus receives the latest run status from the Engine.
func (*Output) SetThresholds ¶
func (out *Output) SetThresholds(scriptThresholds map[string]stats.Thresholds)
SetThresholds receives the thresholds before the output is Start()-ed.
type Sample ¶
type Sample struct { Type string `json:"type"` Metric string `json:"metric"` Data interface{} `json:"data"` }
Sample is the generic struct that contains all types of data that we send to the cloud.
func NewSampleFromTrail ¶
NewSampleFromTrail just creates a ready-to-send Sample instance directly from a httpext.Trail.
func (Sample) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (*Sample) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Sample) UnmarshalJSON ¶
UnmarshalJSON decodes the Data into the corresponding struct
type SampleDataAggregatedHTTPReqs ¶
type SampleDataAggregatedHTTPReqs struct { Time int64 `json:"time,string"` Type string `json:"type"` Count uint64 `json:"count"` Tags *stats.SampleTags `json:"tags,omitempty"` Values struct { Duration AggregatedMetric `json:"http_req_duration"` Blocked AggregatedMetric `json:"http_req_blocked"` Connecting AggregatedMetric `json:"http_req_connecting"` TLSHandshaking AggregatedMetric `json:"http_req_tls_handshaking"` Sending AggregatedMetric `json:"http_req_sending"` Waiting AggregatedMetric `json:"http_req_waiting"` Receiving AggregatedMetric `json:"http_req_receiving"` Failed AggregatedRate `json:"http_req_failed,omitempty"` } `json:"values"` }
SampleDataAggregatedHTTPReqs is used in aggregated samples for HTTP requests.
func (*SampleDataAggregatedHTTPReqs) Add ¶
func (sdagg *SampleDataAggregatedHTTPReqs) Add(trail *httpext.Trail)
Add updates all agregated values with the supplied trail data
func (*SampleDataAggregatedHTTPReqs) CalcAverages ¶
func (sdagg *SampleDataAggregatedHTTPReqs) CalcAverages()
CalcAverages calculates and sets all `Avg` properties in the `Values` struct
func (SampleDataAggregatedHTTPReqs) MarshalEasyJSON ¶
func (v SampleDataAggregatedHTTPReqs) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (*SampleDataAggregatedHTTPReqs) UnmarshalEasyJSON ¶
func (v *SampleDataAggregatedHTTPReqs) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
type SampleDataMap ¶
type SampleDataMap struct { Time int64 `json:"time,string"` Type stats.MetricType `json:"type"` Tags *stats.SampleTags `json:"tags,omitempty"` Values map[string]float64 `json:"values,omitempty"` }
SampleDataMap is used by samples that contain multiple values, currently that's only iteration metrics (`iter_li_all`) and unaggregated HTTP requests (`http_req_li_all`).
func (SampleDataMap) MarshalEasyJSON ¶
func (v SampleDataMap) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (*SampleDataMap) UnmarshalEasyJSON ¶
func (v *SampleDataMap) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
type SampleDataSingle ¶
type SampleDataSingle struct { Time int64 `json:"time,string"` Type stats.MetricType `json:"type"` Tags *stats.SampleTags `json:"tags,omitempty"` Value float64 `json:"value"` }
SampleDataSingle is used in all simple un-aggregated single-value samples.
func (SampleDataSingle) MarshalEasyJSON ¶
func (v SampleDataSingle) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (*SampleDataSingle) UnmarshalEasyJSON ¶
func (v *SampleDataSingle) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface