writer

package
v0.0.0-...-5655933 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitWriters

func InitWriters() error

func WriteSamples

func WriteSamples(samples []*types.Sample)

WriteSamples convert samples to []prompb.TimeSeries and batch write to queue

func WriteTimeSeries

func WriteTimeSeries(timeSeries []prompb.TimeSeries)

WriteTimeSeries write prompb.TimeSeries to all writers

Types

type Snapshot

type Snapshot struct {
	FailCount  uint64
	FailTotal  uint64
	TotalCount uint64

	QueueSize uint64
}

Writers manage all writers and metric queue

func QueueMetrics

func QueueMetrics() *Snapshot

type Writer

type Writer struct {
	Opts   config.WriterOption
	Client api.Client
}

func (Writer) Write

func (w Writer) Write(items []prompb.TimeSeries)

type Writers

type Writers struct {
	sync.Mutex

	Snapshot
	// contains filtered or unexported fields
}

Writers manage all writers and metric queue

func (*Writers) LoopRead

func (ws *Writers) LoopRead()

Jump to

Keyboard shortcuts

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