storage

package
v0.0.0-...-830f7db Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LatencyMetricName = "latency"
	P50MetricName     = "p50"
	P90MetricName     = "p90"
	P95MetricName     = "p95"
	P99MetricName     = "p99"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeStorage

type FakeStorage struct {
	Values []float64
	// contains filtered or unexported fields
}

func (*FakeStorage) Insert

func (f *FakeStorage) Insert(_ *Result) error

func (*FakeStorage) Select

func (f *FakeStorage) Select(_ string, _, _ time.Time) ([]float64, error)

type Reader

type Reader interface {
	Select(metric string, start, end time.Time) ([]float64, error)
}

type Result

type Result struct {
	Code      uint16
	Timestamp time.Time
	Latency   time.Duration
	P50       time.Duration
	P90       time.Duration
	P95       time.Duration
	P99       time.Duration
}

Result contains the results of a single HTTP request.

type Storage

type Storage interface {
	Writer
	Reader
}

Storage provides goroutine safe capabilities of insertion into and retrieval from the time-series storage. Backed by "nakabonne/tstorage"

func NewStorage

func NewStorage(partitionDuration time.Duration) (Storage, error)

type Writer

type Writer interface {
	Insert(result *Result) error
}

Jump to

Keyboard shortcuts

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