gorilla

package
v0.0.0-...-1b5f0b1 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2017 License: GPL-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 Gorilla

type Gorilla interface {
	Start()
	ListSeries() []Meta
	Delete(m Meta) <-chan []*pb.Point
	Write(p *pb.Point) gobol.Error
	WAL(ksts string, blockID int64, pts []byte) error
	Read(ksid, tsid string, start, end int64) ([]*pb.Point, gobol.Error)
	ToDepot(metas []Meta)
	Cleanup(metas []Meta)
	Stop()
}

type Meta

type Meta struct {
	KSID      string
	TSID      string
	LastCheck int64
}

type Pnt

type Pnt struct {
	Date  int64
	Value float32
	Empty bool
}

type Pnts

type Pnts []*pb.Point

func (Pnts) Len

func (s Pnts) Len() int

func (Pnts) Less

func (s Pnts) Less(i, j int) bool

func (Pnts) Swap

func (s Pnts) Swap(i, j int)

type Point

type Point struct {
	Message   TSDBpoint
	ID        string
	KsID      string
	Timestamp int64
	Number    bool
}

type Storage

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

Storage keeps all timeseries in memory after a while the serie will be saved at cassandra if the time range is not in memory it must query cassandra

func New

func New(
	lgr *zap.Logger,
	sts *tsstats.StatsTS,
	persist depot.Persistence,
	w *wal.WAL,
	saveInterval int64,
) *Storage

New returns Storage

func (*Storage) Cleanup

func (s *Storage) Cleanup(metas []Meta)

func (*Storage) Delete

func (s *Storage) Delete(m Meta) <-chan []*pb.Point

func (*Storage) ListSeries

func (s *Storage) ListSeries() []Meta

func (*Storage) Read

func (s *Storage) Read(ksid, tsid string, start, end int64) ([]*pb.Point, gobol.Error)

Read points from a timeseries, if range start bigger than 24hours it will read points from persistence

func (*Storage) Start

func (s *Storage) Start()

Start dispatch a goroutine to save buckets in cassandra. All buckets with more than an hour must be compressed and saved in cassandra.

func (*Storage) Stop

func (s *Storage) Stop()

func (*Storage) ToDepot

func (s *Storage) ToDepot(metas []Meta)

func (*Storage) WAL

func (s *Storage) WAL(ksts string, blockID int64, pts []byte) error

func (*Storage) Write

func (s *Storage) Write(p *pb.Point) gobol.Error

Add new point in a timeseries

type TSDBpoint

type TSDBpoint struct {
	Metric    string            `json:"metric,omitempty"`
	Timestamp int64             `json:"timestamp,omitempty"`
	Value     *float32          `json:"value,omitempty"`
	Text      string            `json:"text,omitempty"`
	Tags      map[string]string `json:"tags,omitempty"`
}

type TSDBpoints

type TSDBpoints []TSDBpoint

func (TSDBpoints) Validate

func (p TSDBpoints) Validate() gobol.Error

Jump to

Keyboard shortcuts

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