Documentation ¶
Overview ¶
Package insights contains the logic for the k6 cloud insights output.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client interface { IngestRequestMetadatasBatch(context.Context, insights.RequestMetadatas) error Close() error }
Client is an interface for sending request metadatas to the Insights API.
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
Collector is an implementation of RequestMetadatasCollector. Its purpose is to filter and store httpext.Trail samples containing tracing data for later flushing.
func NewCollector ¶
NewCollector creates a new Collector.
func (*Collector) CollectRequestMetadatas ¶
func (c *Collector) CollectRequestMetadatas(sampleContainers []metrics.SampleContainer)
CollectRequestMetadatas filters httpext.Trail samples containing trace ids and stores them as insights.RequestMetadatas in the buffer.
func (*Collector) PopAll ¶
func (c *Collector) PopAll() insights.RequestMetadatas
PopAll returns all collected insights.RequestMetadatas and clears the buffer.
type Flusher ¶
type Flusher struct {
// contains filtered or unexported fields
}
Flusher is an implementation of RequestMetadatasFlusher. Its purpose is to retrieve data from a collector and send it to the insights backend.
func NewFlusher ¶
func NewFlusher(client Client, collector RequestMetadatasCollector) *Flusher
NewFlusher creates a new Flusher.
type RequestMetadatasCollector ¶
type RequestMetadatasCollector interface { CollectRequestMetadatas([]metrics.SampleContainer) PopAll() insights.RequestMetadatas }
RequestMetadatasCollector is an interface for collecting request metadatas and retrieving them, so they can be flushed using a flusher.
type RequestMetadatasFlusher ¶
type RequestMetadatasFlusher interface {
Flush() error
}
RequestMetadatasFlusher is an interface for flushing data to the cloud.