writer

package
Version: v0.0.0-...-a5c9b4a Latest Latest
Warning

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

Go to latest
Published: May 6, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrMetricTooLong is returned when trying to write a metric that exceeds the length limit
	// defined by client.MaxMetricLength
	ErrMetricTooLong = fmt.Errorf("metric length is too long to write")
	// ErrTooManyMetrics is returned when calling Write with too many metrics
	// defined by client.MaxBatchSize
	ErrTooManyMetrics = fmt.Errorf("too many metrics to send")

	// ErrFlushFailure is returned when Flush fails for any reason
	ErrFlushFailure = fmt.Errorf("flush failure")
)

Functions

This section is empty.

Types

type File

type File struct {
	// contains filtered or unexported fields
}

File writes metrics to an io.Writer

func NewFile

func NewFile(w io.Writer, c *prometheus.CounterVec) *File

NewFile creates a new File writer with the provided writer

func (*File) Name

func (w *File) Name() string

Name is the name of this writer

func (*File) Write

func (w *File) Write(mets []aggregate.MetricWithValue) error

Write writes metrics to the file

type Sonar

type Sonar struct {
	// contains filtered or unexported fields
}

Sonar writes metrics to DigitalOcean sonar

func NewSonar

func NewSonar(client tsclient.Client, c *prometheus.CounterVec) *Sonar

NewSonar creates a new Sonar writer

func (*Sonar) Name

func (s *Sonar) Name() string

Name is the name of this writer

func (*Sonar) Write

func (s *Sonar) Write(mets []aggregate.MetricWithValue) error

Write writes the metrics to Sonar and returns the amount of time to wait before the next write

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL