cmd

package
v2.4.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintConfig

func PrintConfig(config interface{})

PrintConfig prints config to stdout

func ReadConfig

func ReadConfig(configFileName string, config interface{}) error

ReadConfig parses config file by the given path into Moira-used type

func StartProfiling

func StartProfiling(logger moira.Logger, config ProfilerConfig)

StartProfiling starts http server with profiling data at given port

Types

type GraphiteConfig

type GraphiteConfig struct {
	// If true, graphite sender will be enabled.
	Enabled bool `yaml:"enabled"`
	// If true, runtime stats will be captured and sent to graphite. Note: It takes to call stoptheworld() with configured "graphite.interval" to capture runtime stats (https://golang.org/src/runtime/mstats.go)
	RuntimeStats bool `yaml:"runtime_stats"`
	// Graphite relay URI, format: ip:port
	URI string `yaml:"uri"`
	// Moira metrics prefix. Use 'prefix: {hostname}' to use hostname autoresolver.
	Prefix string `yaml:"prefix"`
	// Metrics sending interval
	Interval string `yaml:"interval"`
}

GraphiteConfig is graphite metrics config structure that initialises at the start of moira

func (*GraphiteConfig) GetSettings

func (graphiteConfig *GraphiteConfig) GetSettings() graphite.Config

GetSettings returns graphite metrics config parsed from moira config files

type LoggerConfig

type LoggerConfig struct {
	LogFile  string `yaml:"log_file"`
	LogLevel string `yaml:"log_level"`
}

LoggerConfig is logger settings structure that initialises at the start of moira

type ProfilerConfig

type ProfilerConfig struct {
	// Define variable as valid non-empty string to enable pprof server. For example ':10000' will enable server available at http://moira.company.com:10000/debug/pprof/
	Listen string `yaml:"listen"`
}

ProfilerConfig is pprof settings structure that initialises at the start of moira

type RedisConfig

type RedisConfig struct {
	// Redis Sentinel cluster name
	MasterName string `yaml:"master_name"`
	// Redis Sentinel address list, format: {host1_name:port};{ip:port}
	SentinelAddrs string `yaml:"sentinel_addrs"`
	// Redis node ip-address or host name
	Host string `yaml:"host"`
	// Redis node port
	Port string `yaml:"port"`
	// Redis database id
	DBID int `yaml:"dbid"`
}

RedisConfig is a redis config structure that initialises at the start of moira Use fields MasterName and SentinelAddrs to enable Redis Sentinel support, use Host and Port fields otherwise.

func (*RedisConfig) GetSettings

func (config *RedisConfig) GetSettings() redis.Config

GetSettings returns redis config parsed from moira config files

type RemoteConfig

type RemoteConfig struct {
	// graphite url e.g http://graphite/render
	URL string `yaml:"url"`
	// Min period to perform triggers re-check. Note: Reducing of this value leads to increasing of CPU and memory usage values
	CheckInterval string `yaml:"check_interval"`
	// Timeout for remote requests
	Timeout string `yaml:"timeout"`
	// Username for basic auth
	User string `yaml:"user"`
	// Password for basic auth
	Password string `yaml:"password"`
	// If true, remote worker will be enabled.
	Enabled bool `yaml:"enabled"`
}

RemoteConfig is remote graphite settings structure

func (*RemoteConfig) GetSettings

func (config *RemoteConfig) GetSettings() *remote.Config

GetSettings returns remote config parsed from moira config files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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