models

package
v0.0.0-...-f73114c Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const GITRFC = "Mon, 2 Jan 2006 15:04:05 -0700"

Variables

This section is empty.

Functions

This section is empty.

Types

type Input

type Input struct {

	// Whether or not this object will be processed by the `benchmark` package
	IsBenchmark bool `json:"-"`
	// Number of days to look back for regressions (only if IsBenchmark is true)
	RegressionDays string `json:"-"`
	// Acceptable performance decrease without being considered as regressions, as a percentage
	// (only if IsBenchmark is true)
	RegressionMargin float64 `json:"-"`

	// URL of the APM Server under test
	ApmServerUrl string `json:"apm_url"`
	// Secret token of the APM Server under test
	ApmServerSecret string `json:"-"`
	// API Key for communication between APM Server and the Go agent
	APIKey string `json:"-"`
	// If true, it will index the performance report of a run in ElasticSearch
	SkipIndexReport bool `json:"-"`
	// URL of the Elasticsearch instance used for indexing the performance report
	ElasticsearchUrl string `json:"-"`
	// <username:password> of the Elasticsearch instance used for indexing the performance report
	ElasticsearchAuth string `json:"-"`
	// URL of the Elasticsearch instance used by APM Server
	ApmElasticsearchUrl string `json:"elastic_url,omitempty"`
	// <username:password> of the Elasticsearch instance used by APM Server
	ApmElasticsearchAuth string `json:"-"`
	// Service name passed to the tracer
	ServiceName string `json:"service_name,omitempty"`

	// Run timeout of the performance test (ends the test when reached)
	RunTimeout time.Duration `json:"run_timeout"`
	// Timeout for flushing the workload to APM Server
	FlushTimeout time.Duration `json:"flush_timeout"`
	// Number of Instances that are creating load
	Instances int `json:"instances"`
	// DelayMillis is the maximum amount of milliseconds to wait per instance before starting it,
	// can be used to add some randomness for producing load
	DelayMillis int `json:"delay_millis"`
	// Frequency at which the tracer will generate transactions
	TransactionFrequency time.Duration `json:"transaction_generation_frequency"`
	// Maximum number of transactions to push to the APM Server (ends the test when reached)
	TransactionLimit int `json:"transaction_generation_limit"`
	// Maximum number of spans per transaction
	SpanMaxLimit int `json:"spans_generated_max_limit"`
	// Minimum number of spans per transaction
	SpanMinLimit int `json:"spans_generated_min_limit"`
	// Frequency at which the tracer will generate errors
	ErrorFrequency time.Duration `json:"error_generation_frequency"`
	// Maximum number of errors to push to the APM Server (ends the test when reached)
	ErrorLimit int `json:"error_generation_limit"`
	// Maximum number of stacktrace frames per error
	ErrorFrameMaxLimit int `json:"error_generation_frames_max_limit"`
	// Minimum number of stacktrace frames per error
	ErrorFrameMinLimit int `json:"error_generation_frames_min_limit"`
}

Input holds all the parameters given to a load test work. Most parameters describe a workload pattern, others are required to create performance reports.

func (Input) WithErrors

func (in Input) WithErrors(limit int, freq time.Duration) Input

func (Input) WithFrames

func (in Input) WithFrames(f int) Input

func (Input) WithSpans

func (in Input) WithSpans(s int) Input

func (Input) WithTransactions

func (in Input) WithTransactions(limit int, freq time.Duration) Input

type Report

type Report struct {

	// Input arguments to the load test work
	Input

	// Elasticsearch doc id
	ReportId string `json:"report_id"`
	// see GITRFC
	ReportDate string `json:"report_date"`
	// hey-apm host
	ReporterHost string `json:"reporter_host"`
	// like reportDate, but better for querying ES and sorting
	Timestamp time.Time `json:"@timestamp"`
	// any arbitrary strings set by the user, meant to filter results
	Labels []string `json:"labels,omitempty"`
	// name of the test run
	TestName string `json:"test_name,omitempty"`
	// apm-server release version or build sha
	ApmVersion string `json:"apm_version,omitempty"`
	// commit SHA
	ApmBuild string `json:"apm_build,omitempty"`
	// commit date
	ApmBuildDate time.Time `json:"apm_build_date,omitempty"`
	// list of settings apm-server has been started with
	// some are explicitly omitted (eg passwords)
	// only captured options passed with -E when expvar is enabled
	ApmSettings map[string]string `json:"apm_settings,omitempty"`

	// total elapsed (timeout + flush)
	Elapsed float64 `json:"elapsed"`

	// number of total requests to apm-server
	Requests uint64 `json:"requests"`
	// number of total failed requests
	FailedRequests uint64 `json:"failed_requests"`

	// number of errors generated
	ErrorsGenerated uint64 `json:"errors_generated"`
	// number of errors sent to apm-server
	ErrorsSent uint64 `json:"errors_sent"`
	// number of errors indexed in Elasticsearch
	ErrorsIndexed uint64 `json:"errors_indexed"`

	// number of transactions generated (as per user input)
	TransactionsGenerated uint64 `json:"transactions_generated"`
	// number of transactions sent to apm-server
	TransactionsSent uint64 `json:"transactions_sent"`
	// number of transactions indexed in Elasticsearch
	TransactionsIndexed uint64 `json:"transactions_indexed"`
	// TODO
	// number of stacktrace frames per span
	// SpanFrames int `json:"span_frames"`
	// number of generated spans
	SpansGenerated uint64 `json:"spans_generated"`
	// number of spans sent to apm-server
	SpansSent uint64 `json:"spans_sent"`
	// number of spans indexed in Elasticsearch
	SpansIndexed uint64 `json:"spans_indexed"`

	// total generated
	EventsGenerated uint64 `json:"events_generated"`
	// total sent
	EventsSent uint64 `json:"events_sent"`
	// total accepted
	EventsAccepted uint64 `json:"events_accepted"`
	// total indexed
	EventsIndexed uint64 `json:"events_indexed"`

	// total memory allocated in bytes
	TotalAlloc *uint64 `json:"total_alloc,omitempty"`
	// total memory allocated in the heap, in bytes
	HeapAlloc *uint64 `json:"heap_alloc,omitempty"`
	// total number of mallocs
	Mallocs *uint64 `json:"mallocs,omitempty"`
	// number of GC runs
	NumGC *uint64 `json:"num_gc,omitempty"`
}

Report holds performance statistics generated by a load test work.

func (Report) Performance

func (r Report) Performance() float64

Jump to

Keyboard shortcuts

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