Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadConfig ¶
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 ¶
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
DB int `yaml:"dbid"`
ConnectionLimit int `yaml:"connection_limit"`
}
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) GetRemoteSourceSettings ¶
func (config *RemoteConfig) GetRemoteSourceSettings() *remoteSource.Config
GetRemoteSourceSettings returns remote config parsed from moira config files