carbon

package
v0.14.1-0...-915d78e Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2020 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const MetricEndpointLocal = "local"

Variables

This section is empty.

Functions

func NewLoggingConfig

func NewLoggingConfig() zapwriter.Config

func PrintDefaultConfig

func PrintDefaultConfig() error

PrintDefaultConfig ...

func RuntimeStat

func RuntimeStat(send helper.StatCallback)

func TestConfig

func TestConfig(rootDir string) string

TestConfig creates config with all files in root directory

Types

type App

type App struct {
	sync.RWMutex
	ConfigFilename string
	Config         *Config
	Api            *api.Api
	Cache          *cache.Cache
	Receivers      []*NamedReceiver
	CarbonLink     *cache.CarbonlinkListener
	Persister      *persister.Whisper
	Carbonserver   *carbonserver.CarbonserverListener
	Tags           *tags.Tags
	Collector      *Collector // (!!!) Should be re-created on every change config/modules
	PromRegisterer prometheus.Registerer
	PromRegistry   *prometheus.Registry
	// contains filtered or unexported fields
}

func New

func New(configFilename string) *App

New App instance

func (*App) DumpStop

func (app *App) DumpStop() error

DumpStop implements gracefully stop: * Start writing all new data to xlogs * Stop cache worker * Dump all cache to file * Stop listeners * Close xlogs * Exit application

func (*App) Loop

func (app *App) Loop()

Loop ...

func (*App) ParseConfig

func (app *App) ParseConfig() error

ParseConfig loads config from config file, schemas.conf, aggregation.conf

func (*App) ReloadConfig

func (app *App) ReloadConfig() error

ReloadConfig reloads some settings from config

func (*App) Restore

func (app *App) Restore(storeFunc func(*points.Points), path string, rps int)

Restore from dump.path

func (*App) RestoreFromDir

func (app *App) RestoreFromDir(dumpDir string, storeFunc func(*points.Points))

RestoreFromDir cache and input dumps from disk to memory

func (*App) RestoreFromFile

func (app *App) RestoreFromFile(filename string, storeFunc func(*points.Points)) error

RestoreFromFile read and parse data from single file

func (*App) Start

func (app *App) Start() (err error)

Start starts

func (*App) Stop

func (app *App) Stop()

Stop force stop all components

type Collector

type Collector struct {
	helper.Stoppable
	// contains filtered or unexported fields
}

func NewCollector

func NewCollector(app *App) *Collector

type Config

type Config struct {
	Common       commonConfig                        `toml:"common"`
	Whisper      whisperConfig                       `toml:"whisper"`
	Cache        cacheConfig                         `toml:"cache"`
	Udp          *udp.Options                        `toml:"udp"`
	Tcp          *tcp.Options                        `toml:"tcp"`
	Pickle       *tcp.FramingOptions                 `toml:"pickle"`
	Receiver     map[string](map[string]interface{}) `toml:"receiver"`
	Carbonlink   carbonlinkConfig                    `toml:"carbonlink"`
	Grpc         grpcConfig                          `toml:"grpc"`
	Tags         tagsConfig                          `toml:"tags"`
	Carbonserver carbonserverConfig                  `toml:"carbonserver"`
	Dump         dumpConfig                          `toml:"dump"`
	Pprof        pprofConfig                         `toml:"pprof"`
	Logging      []zapwriter.Config                  `toml:"logging"`
	Prometheus   prometheusConfig                    `toml:"prometheus"`
}

Config ...

func NewConfig

func NewConfig() *Config

NewConfig ...

func ReadConfig

func ReadConfig(filename string) (*Config, error)

ReadConfig ...

type Duration

type Duration struct {
	time.Duration
}

Duration wrapper time.Duration for TOML

func (*Duration) MarshalText

func (d *Duration) MarshalText() ([]byte, error)

MarshalText encode text with TOML format

func (*Duration) UnmarshalText

func (d *Duration) UnmarshalText(text []byte) error

UnmarshalText from TOML

func (*Duration) Value

func (d *Duration) Value() time.Duration

Value return time.Duration value

type NamedReceiver

type NamedReceiver struct {
	receiver.Receiver
	Name string
}

type SyncWriter

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

func (*SyncWriter) Flush

func (s *SyncWriter) Flush() error

func (*SyncWriter) Write

func (s *SyncWriter) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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