stress

package
v0.0.0-...-c527c4f Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Write

func Write(pts []lineprotocol.Point, c write.Client, cfg WriteConfig) (uint64, time.Duration)

Write takes in a slice of lineprotocol.Points, a write.Client, and a WriteConfig. It will attempt to write data to the target until one of the following conditions is met. 1. We reach that MaxPoints specified in the WriteConfig. 2. We've passed the Deadline specified in the WriteConfig.

Types

type WriteConfig

type WriteConfig struct {
	BatchSize uint64
	MaxPoints uint64

	// If 0 (NoCompression), do not gzip at all.
	// Otherwise, pass this value to the gzip writer.
	GzipLevel int

	Deadline time.Time
	Tick     <-chan time.Time
	Results  chan<- WriteResult
}

WriteConfig specifies the configuration for the Write function.

type WriteResult

type WriteResult struct {
	LatNs      int64
	StatusCode int
	Body       string // Only populated when unusual status code encountered.
	Err        error
	Timestamp  int64
}

WriteResult contains the latency, status code, and error type each time a write happens.

Jump to

Keyboard shortcuts

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