storages

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2017 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blackhole

type Blackhole struct{}

Blackhole is a non-functional dummy storage for testing.

func NewBlackhole

func NewBlackhole() *Blackhole

func (*Blackhole) Collect

func (m *Blackhole) Collect(c chan<- prometheus.Metric)

func (*Blackhole) Describe

func (m *Blackhole) Describe(c chan<- *prometheus.Desc)

func (*Blackhole) Read

func (m *Blackhole) Read(ctx context.Context, queries []Query) (*prompb.ReadResponse, error)

func (*Blackhole) Write

func (m *Blackhole) Write(ctx context.Context, data *prompb.WriteRequest) error

type ClickHouse

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

ClickHouse implements storage interface for the ClickHouse.

func NewClickHouse

func NewClickHouse(dsn string, database string, drop bool) (*ClickHouse, error)

func (*ClickHouse) Collect

func (ch *ClickHouse) Collect(c chan<- prometheus.Metric)

func (*ClickHouse) Describe

func (ch *ClickHouse) Describe(c chan<- *prometheus.Desc)

func (*ClickHouse) Read

func (ch *ClickHouse) Read(ctx context.Context, queries []Query) (res *prompb.ReadResponse, err error)

func (*ClickHouse) Write

func (ch *ClickHouse) Write(ctx context.Context, data *prompb.WriteRequest) (err error)

type MatchType

type MatchType int
const (
	MatchEqual MatchType = iota
	MatchNotEqual
	MatchRegexp
	MatchNotRegexp
)

func (MatchType) String

func (m MatchType) String() string

type Matcher

type Matcher struct {
	Name  string
	Type  MatchType
	Value string
	// contains filtered or unexported fields
}

func (Matcher) String

func (m Matcher) String() string

type Matchers

type Matchers []Matcher

func (Matchers) MatchLabels

func (ms Matchers) MatchLabels(labels []*prompb.Label) bool

func (Matchers) String

func (ms Matchers) String() string

type Memory

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

Memory is a functional dummy storage for testing.

func NewMemory

func NewMemory() *Memory

func (*Memory) Collect

func (m *Memory) Collect(c chan<- prometheus.Metric)

func (*Memory) Describe

func (m *Memory) Describe(c chan<- *prometheus.Desc)

func (*Memory) Read

func (m *Memory) Read(ctx context.Context, queries []Query) (*prompb.ReadResponse, error)

func (*Memory) Write

func (m *Memory) Write(ctx context.Context, data *prompb.WriteRequest) error

type Query

type Query struct {
	Start    model.Time
	End      model.Time
	Matchers Matchers
}

Query represents query against stored data.

func (Query) String

func (q Query) String() string

type Storage

type Storage interface {
	// Read runs queries in the storage and returns the same amount of matrixes.
	// Event if they are empty, they must be present in the returned slice.
	Read(context.Context, []Query) (*prompb.ReadResponse, error)

	// Write puts data into storage.
	Write(context.Context, *prompb.WriteRequest) error

	prometheus.Collector
}

Storage represents generic storage.

Jump to

Keyboard shortcuts

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