Documentation ¶
Overview ¶
Package insights contains the domain data structures and client logic for the k6 cloud Insights API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrClientAlreadyInitialized is returned when the client is already initialized. ErrClientAlreadyInitialized = errors.New("insights client already initialized") // ErrClientClosed is returned when the client is closed. ErrClientClosed = errors.New("insights client closed") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the client for the k6 Insights ingester service.
func (*Client) IngestRequestMetadatasBatch ¶
func (c *Client) IngestRequestMetadatasBatch(ctx context.Context, requestMetadatas RequestMetadatas) error
IngestRequestMetadatasBatch ingests a batch of request metadatas.
type ClientAuthConfig ¶
type ClientAuthConfig struct { Enabled bool TestRunID int64 Token string RequireTransportSecurity bool }
ClientAuthConfig is the configuration for the client authentication.
type ClientBackoffConfig ¶
ClientBackoffConfig is the configuration for the client retries using the backoff exponential with jitter algorithm.
type ClientConfig ¶
type ClientConfig struct { IngesterHost string Timeout time.Duration ConnectConfig ClientConnectConfig AuthConfig ClientAuthConfig TLSConfig ClientTLSConfig RetryConfig ClientRetryConfig }
ClientConfig is the configuration for the client.
func NewDefaultClientConfigForTestRun ¶
func NewDefaultClientConfigForTestRun(ingesterHost, authToken string, testRunID int64) ClientConfig
NewDefaultClientConfigForTestRun creates a new default client config for a test run.
type ClientConnectConfig ¶
type ClientConnectConfig struct { Block bool FailOnNonTempDialError bool Timeout time.Duration Dialer func(context.Context, string) (net.Conn, error) }
ClientConnectConfig is the configuration for the client connection.
type ClientRetryConfig ¶
type ClientRetryConfig struct { RetryableStatusCodes string MaxAttempts uint PerRetryTimeout time.Duration BackoffConfig ClientBackoffConfig }
ClientRetryConfig is the configuration for the client retries.
type ClientTLSConfig ¶
ClientTLSConfig is the configuration for the client TLS.
type ProtocolHTTPLabels ¶
ProtocolHTTPLabels describes labels associated with a single HTTP request.
func (ProtocolHTTPLabels) IsProtocolLabels ¶
func (ProtocolHTTPLabels) IsProtocolLabels()
IsProtocolLabels is a dummy implementation to satisfy the ProtocolLabels interface.
type ProtocolLabels ¶
type ProtocolLabels interface {
IsProtocolLabels()
}
ProtocolLabels is a dummy interface that is used for compile-time type checking.
type RequestMetadata ¶
type RequestMetadata struct { TraceID string Start time.Time End time.Time TestRunLabels TestRunLabels ProtocolLabels ProtocolLabels }
RequestMetadata describes metadata associated with a single *traced* request.
type RequestMetadatas ¶
type RequestMetadatas []RequestMetadata
RequestMetadatas is a slice of RequestMetadata.
type TestRunLabels ¶
TestRunLabels describes labels associated with a single test run.