tlmanager

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2020 License: MIT Imports: 8 Imported by: 0

README

Timeline Manager

This library manages multiple timeline instances to allow the use of multiple backends and provides useful shortcut functions to manipulate these timelines.

Timeline library?

Click here

Sample TOML

hashingAlgorithm = "shake128"
hashSize = 6
transportBufferSize = 10000
serializerBufferSize = 2048
batchSendInterval = "30s"
requestTimeout = "5s"
maxReadTimeout = "100ms"
reconnectionTimeout = "3s"
dataTTL = "2m"
readBufferSize = 64
debugOutput = true
debugInput = true

[[stats.backends]]
host = "loghost"
port = 8123
type = "normal"
cycleDuration = "15s"
addHostTag = true
[stats.backends.commonTags]
    ttl = "1"
    ksid = "normal"

[[stats.backends]]
host = "loghost"
port = 8123
type = "archive"
cycleDuration = "15s"
addHostTag = true
[stats.backends.commonTags]
    ttl = "1"
    ksid = "storage"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackendItem

type BackendItem struct {
	timeline.Backend
	Type          StorageType
	CycleDuration funks.Duration
	AddHostTag    bool
	CommonTags    map[string]string
}

BackendItem - one backend configuration

type Configuration

type Configuration struct {
	Backends         []BackendItem
	HashingAlgorithm hashing.Algorithm
	HashSize         int
	DataTTL          funks.Duration
	timeline.OpenTSDBTransportConfig
}

Configuration - configuration

type StorageType

type StorageType string

StorageType - the storage type constante

const (
	// Normal - normal storage backend
	Normal StorageType = "normal"

	// Archive - archive storage backend
	Archive StorageType = "archive"
)

type TimelineManager

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

TimelineManager - manages the configured number of timeline manager instances

func New

func New(configuration *Configuration) (*TimelineManager, error)

New - creates a new instance

func (*TimelineManager) AccumulateCustomHashN

func (tm *TimelineManager) AccumulateCustomHashN(hash string) (bool, error)

AccumulateCustomHashN - calls the accumulate function using normal storage

func (*TimelineManager) AccumulateHashedData

func (tm *TimelineManager) AccumulateHashedData(stype StorageType, hash string) (bool, error)

AccumulateHashedData - accumulates a hashed data

func (*TimelineManager) Flatten

func (tm *TimelineManager) Flatten(caller string, stype StorageType, op timeline.FlatOperation, value float64, metric string, tags ...interface{})

Flatten - performs a flatten operation

func (*TimelineManager) FlattenAvgN

func (tm *TimelineManager) FlattenAvgN(caller string, value float64, metric string, tags ...interface{})

FlattenAvgN - calls the Flatten function using normal storage and average operation

func (*TimelineManager) FlattenCountIncA

func (tm *TimelineManager) FlattenCountIncA(caller string, metric string, tags ...interface{})

FlattenCountIncA - calls the Flatten function using archive storage and count operation (adds 1 to the value)

func (*TimelineManager) FlattenCountIncN

func (tm *TimelineManager) FlattenCountIncN(caller string, metric string, tags ...interface{})

FlattenCountIncN - calls the Flatten function using normal storage and count operation (adds 1 to the value)

func (*TimelineManager) FlattenCountN

func (tm *TimelineManager) FlattenCountN(caller string, value float64, metric string, tags ...interface{})

FlattenCountN - calls the Flatten function using normal storage and count operation

func (*TimelineManager) FlattenMaxN

func (tm *TimelineManager) FlattenMaxN(caller string, value float64, metric string, tags ...interface{})

FlattenMaxN - calls the Flatten function using normal storage and maximum operation

func (*TimelineManager) FlattenMinN

func (tm *TimelineManager) FlattenMinN(caller string, value float64, metric string, tags ...interface{})

FlattenMinN - calls the Flatten function using normal storage and minimum operation

func (*TimelineManager) Shutdown

func (tm *TimelineManager) Shutdown()

Shutdown - shuts down the timeline manager

func (*TimelineManager) Start

func (tm *TimelineManager) Start() error

Start - starts the timeline manager

func (*TimelineManager) StoreCustomHashN

func (tm *TimelineManager) StoreCustomHashN(hash string, metric string, tags ...interface{}) error

StoreCustomHashN - calls the store hash function using normal storage

func (*TimelineManager) StoreHashedData

func (tm *TimelineManager) StoreHashedData(stype StorageType, hash string, ttl time.Duration, metric string, tags ...interface{}) error

StoreHashedData - stores the hashed data

func (*TimelineManager) StoreNoTTLCustomHashN

func (tm *TimelineManager) StoreNoTTLCustomHashN(hash string, metric string, tags ...interface{}) error

StoreNoTTLCustomHashN - calls the store hash function using normal storage with no ttl

Jump to

Keyboard shortcuts

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