persister

package
v0.0.0-...-7fa8e96 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	MetricsClientConfig metrics_client.Config
	StorageClientConfig storage.Config
	// contains filtered or unexported fields
}

Config contains the configuration require to create a Persister

func (*Config) RegisterFlags

func (cfg *Config) RegisterFlags(f *flag.FlagSet)

RegisterFlags adds the flags required to config this to the given FlagSet

type Persister

type Persister struct {
	*sync.Mutex
	// contains filtered or unexported fields
}

Persister ingests payloads that are serialized into metrics and repeatedly sent to a metrics endpoint in the schema.MetricData format

func New

func New(cfg *Config) (*Persister, error)

New constructs a new persister

func (*Persister) IndexHandler

func (p *Persister) IndexHandler(w http.ResponseWriter, r *http.Request)

IndexHandler serves up the metrics currently being persisted

func (*Persister) Persist

func (p *Persister) Persist(rowKey string, metrics []*schema.MetricData) error

Persist add metrics to memory map for persisting

func (*Persister) PersistHandler

func (p *Persister) PersistHandler(w http.ResponseWriter, r *http.Request)

PersistHandler handles requests with payloads meant to be persisted

func (*Persister) Push

func (p *Persister) Push(quit chan struct{})

Push schedules sending metrics to the gateway

func (*Persister) RemoveRowsHandler

func (p *Persister) RemoveRowsHandler(w http.ResponseWriter, r *http.Request)

RemoveRowsHandler handles requests to remove payloads from the persister

func (*Persister) Send

func (p *Persister) Send() error

Send packages and sends metrics to the gateway

type RemoveRowsRequest

type RemoveRowsRequest struct {
	RowKeys []string `json:"rowkeys"`
}

RemoveRowsRequest contains the information required to remove metrics from the persister

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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