uploader

package
v0.11.7 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: MIT Imports: 28 Imported by: 3

Documentation

Index

Constants

View Source
const DefaultTreeDate = 42 // 1970-02-12
View Source
const ReverseLevelOffset = 10000
View Source
const ReverseTreeLevelOffset = 30000
View Source
const TreeLevelOffset = 20000

Variables

This section is empty.

Functions

This section is empty.

Types

type Base added in v0.7.0

type Base struct {
	stop.Struct
	sync.Mutex
	// contains filtered or unexported fields
}

func (*Base) MarkAsFinished added in v0.7.0

func (u *Base) MarkAsFinished(filename string)

func (*Base) RemoveFromQueue added in v0.7.0

func (u *Base) RemoveFromQueue(filename string)

func (*Base) Start added in v0.7.0

func (u *Base) Start() error

func (*Base) Stat added in v0.7.0

func (u *Base) Stat(send func(metric string, value float64))

type Blacklist added in v0.11.0

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

func NewBlacklist added in v0.11.0

func NewBlacklist(ignoredPatterns []string) *Blacklist

func (*Blacklist) Contains added in v0.11.0

func (blacklist *Blacklist) Contains(value string, isReverse bool) bool

Contains method determines whether or not this value is blacklisted

type CMap

type CMap []*CMapShard

A "thread" safe map of type string:Anything. To avoid lock bottlenecks this map is dived to several (shardCount) map shards.

func NewCMap

func NewCMap() CMap

Creates a new concurrent map.

func (CMap) Add

func (m CMap) Add(key string, value int64)

Sets the given value under the specified key.

func (CMap) Clear added in v0.3.1

func (m CMap) Clear() int

func (CMap) Count

func (m CMap) Count() int

Returns the number of elements within the map.

func (CMap) Exists

func (m CMap) Exists(key string) bool

Retrieves an element from map under given key.

func (CMap) Expire added in v0.7.0

func (m CMap) Expire(ctx context.Context, ttl time.Duration) (int, int64)

func (CMap) ExpireWorker added in v0.7.0

func (m CMap) ExpireWorker(ctx context.Context, ttl time.Duration, expiredCounter *uint32)

func (CMap) GetShard

func (m CMap) GetShard(key string) *CMapShard

Returns shard under given key

func (CMap) Merge added in v0.7.0

func (m CMap) Merge(keys map[string]bool, value int64)

type CMapShard

type CMapShard struct {
	sync.RWMutex // Read Write mutex, guards access to internal map.
	// contains filtered or unexported fields
}

A "thread" safe string to anything map.

type Config added in v0.7.0

type Config struct {
	Type                 string           `toml:"type"`  // points, series, points-reverse, series-reverse
	TableName            string           `toml:"table"` // keep empty for same as key
	Timeout              *config.Duration `toml:"timeout"`
	Date                 string           `toml:"date"` // for tree table
	TreeDate             time.Time        `toml:"-"`
	ZeroTimestamp        bool             `toml:"zero-timestamp"` // for points, points-reverse tables
	TLS                  *config.TLS      `toml:"tls"`            // for secure connection to uploader
	Threads              int              `toml:"threads"`
	URL                  string           `toml:"url"`
	CacheTTL             *config.Duration `toml:"cache-ttl"`
	IgnoredPatterns      []string         `toml:"ignored-patterns,omitempty"` // points, points-reverse
	CompressData         bool             `toml:"compress-data"`              // compress data while sending to clickhouse
	IgnoredTaggedMetrics []string         `toml:"ignored-tagged-metrics"`     // for tagged table; create only `__name__` tag for these metrics and ignore others
	Hash                 string           `toml:"hash"`                       // in index uploader store hash in memory instead of full metric
	DisableDailyIndex    bool             `toml:"disable-daily-index"`        // do not calculate and upload daily index to ClickHouse
	// contains filtered or unexported fields
}

func (*Config) Parse added in v0.7.0

func (cfg *Config) Parse() error

type DebugCacheDumper added in v0.9.0

type DebugCacheDumper interface {
	CacheDump(io.Writer)
}

type Index added in v0.10.0

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

func NewIndex added in v0.10.0

func NewIndex(base *Base) *Index

func (Index) Reset added in v0.10.0

func (u Index) Reset()

func (Index) Start added in v0.10.0

func (u Index) Start() error

func (Index) Stat added in v0.10.0

func (u Index) Stat(send func(metric string, value float64))

type Points added in v0.7.0

type Points struct {
	*Base
	// contains filtered or unexported fields
}

func NewPoints added in v0.7.0

func NewPoints(base *Base, reverse bool) *Points

type Series added in v0.7.0

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

func NewSeries added in v0.7.0

func NewSeries(base *Base, reverse bool) *Series

func (Series) Reset added in v0.7.0

func (u Series) Reset()

func (Series) Start added in v0.7.0

func (u Series) Start() error

func (Series) Stat added in v0.7.0

func (u Series) Stat(send func(metric string, value float64))

type Tagged added in v0.8.0

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

func NewTagged added in v0.8.0

func NewTagged(base *Base) *Tagged

func (Tagged) Reset added in v0.8.0

func (u Tagged) Reset()

func (Tagged) Start added in v0.8.0

func (u Tagged) Start() error

func (Tagged) Stat added in v0.8.0

func (u Tagged) Stat(send func(metric string, value float64))

type Tree added in v0.3.0

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

func NewTree added in v0.7.0

func NewTree(base *Base) *Tree

func (Tree) Reset added in v0.7.0

func (u Tree) Reset()

func (Tree) Start added in v0.7.0

func (u Tree) Start() error

func (Tree) Stat added in v0.7.0

func (u Tree) Stat(send func(metric string, value float64))

type Uploader

type Uploader interface {
	Start() error
	Stop()
	Stat(send func(metric string, value float64))
}

func New

func New(path string, name string, config *Config) (Uploader, error)

type UploaderWithReset added in v0.7.0

type UploaderWithReset interface {
	Reset()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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