Documentation ¶
Index ¶
- Constants
- Variables
- func URLForResults(refID string, config Config) string
- type Client
- func (c *Client) CreateTestRun(testRun *TestRun) (*CreateTestRunResponse, error)
- func (c *Client) Do(req *http.Request, v interface{}) error
- func (c *Client) GetTestProgress(referenceID string) (*TestProgressResponse, error)
- func (c *Client) Login(email string, password string) (*LoginResponse, error)
- func (c *Client) NewRequest(method, url string, data interface{}) (*http.Request, error)
- func (c *Client) PushMetric(referenceID string, noCompress bool, samples []*Sample) error
- func (c *Client) StartCloudTestRun(name string, projectID int, arc *lib.Archive) (string, error)
- func (c *Client) StopCloudTestRun(referenceID string) error
- func (c *Client) TestFinished(referenceID string, thresholds ThresholdResult, tained bool) error
- func (c *Client) ValidateOptions(options lib.Options) error
- type Collector
- type Config
- type ConfigFields
- type CreateTestRunResponse
- type ErrorResponse
- type LoginResponse
- type Sample
- type SampleData
- type TestProgressResponse
- type TestRun
- type ThresholdResult
Constants ¶
View Source
const ( // Default request timeout RequestTimeout = 10 * time.Second // Retry interval RetryInterval = 500 * time.Millisecond // Retry attempts MaxRetries = 3 )
View Source
const ( TestName = "k6 test" MetricPushinteral = 1 * time.Second )
Variables ¶
Functions ¶
func URLForResults ¶ added in v0.19.0
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client handles communication with Load Impact cloud API.
func (*Client) CreateTestRun ¶
func (c *Client) CreateTestRun(testRun *TestRun) (*CreateTestRunResponse, error)
func (*Client) GetTestProgress ¶ added in v0.20.0
func (c *Client) GetTestProgress(referenceID string) (*TestProgressResponse, error)
func (*Client) Login ¶ added in v0.19.0
func (c *Client) Login(email string, password string) (*LoginResponse, error)
func (*Client) NewRequest ¶
func (*Client) PushMetric ¶
func (*Client) StartCloudTestRun ¶ added in v0.19.0
func (*Client) StopCloudTestRun ¶ added in v0.20.0
func (*Client) TestFinished ¶
func (c *Client) TestFinished(referenceID string, thresholds ThresholdResult, tained bool) error
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
Collector sends result data to the Load Impact cloud service.
func (*Collector) GetRequiredSystemTags ¶ added in v0.20.0
GetRequiredSystemTags returns which sample tags are needed by this collector
type Config ¶ added in v0.18.0
type Config ConfigFields
func (Config) MarshalJSON ¶ added in v0.18.0
func (*Config) UnmarshalJSON ¶ added in v0.18.0
func (*Config) UnmarshalText ¶ added in v0.18.0
type ConfigFields ¶ added in v0.18.0
type ConfigFields struct { Token string `json:"token" mapstructure:"token" envconfig:"CLOUD_TOKEN"` Name string `json:"name" mapstructure:"name" envconfig:"CLOUD_NAME"` Host string `json:"host" mapstructure:"host" envconfig:"CLOUD_HOST"` NoCompress bool `json:"no_compress" mapstructure:"no_compress" envconfig:"CLOUD_NO_COMPRESS"` ProjectID int `json:"project_id" mapstructure:"projectID" envconfig:"CLOUD_PROJECT_ID"` DeprecatedToken string `envconfig:"K6CLOUD_TOKEN"` }
type CreateTestRunResponse ¶
type CreateTestRunResponse struct {
ReferenceID string `json:"reference_id"`
}
type ErrorResponse ¶
type ErrorResponse struct { Response *http.Response `json:"-"` Code int `json:"code"` Message string `json:"message"` Details map[string]string `json:"details"` }
ErrorResponse represents an error cause by talking to the API
func (ErrorResponse) Error ¶
func (e ErrorResponse) Error() string
type LoginResponse ¶ added in v0.19.0
type LoginResponse struct {
Token string `json:"token"`
}
type Sample ¶ added in v0.17.0
type Sample struct { Type string `json:"type"` Metric string `json:"metric"` Data SampleData `json:"data"` }
type SampleData ¶ added in v0.17.0
type TestProgressResponse ¶ added in v0.20.0
type ThresholdResult ¶
Click to show internal directories.
Click to hide internal directories.