configuration

package
v0.8.5 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2014 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ONE_MEGABYTE int64 = 1024 * 1024
	ONE_GIGABYTE       = 1024 * ONE_MEGABYTE
	// Maximum integer representable by a word (32bit or 64bit depending
	// on the architecture)
	MAX_INT = int64(^uint(0) >> 1)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminConfig

type AdminConfig struct {
	Port   int
	Assets string
}

type ApiConfig

type ApiConfig struct {
	SslPort     int    `toml:"ssl-port"`
	SslCertPath string `toml:"ssl-cert"`
	Port        int
	ReadTimeout duration `toml:"read-timeout"`
}

type ClusterConfig

type ClusterConfig struct {
	SeedServers               []string `toml:"seed-servers"`
	ProtobufPort              int      `toml:"protobuf_port"`
	ProtobufTimeout           duration `toml:"protobuf_timeout"`
	ProtobufHeartbeatInterval duration `toml:"protobuf_heartbeat"`
	MinBackoff                duration `toml:"protobuf_min_backoff"`
	MaxBackoff                duration `toml:"protobuf_max_backoff"`
	WriteBufferSize           int      `toml:"write-buffer-size"`
	ConcurrentShardQueryLimit int      `toml:"concurrent-shard-query-limit"`
	MaxResponseBufferSize     int      `toml:"max-response-buffer-size"`
}

type CollectdInputConfig added in v0.8.4

type CollectdInputConfig struct {
	Enabled  bool
	Address  string
	Port     int
	Database string
	TypesDB  string `toml:"typesdb"`
}

type Configuration

type Configuration struct {
	AdminHttpPort   int
	ApiHttpSslPort  int
	ApiHttpCertPath string
	ApiHttpPort     int
	ApiReadTimeout  time.Duration

	GraphiteEnabled    bool
	GraphiteAddress    string
	GraphitePort       int
	GraphiteDatabase   string
	GraphiteUdpEnabled bool

	CollectdEnabled  bool
	CollectdAddress  string
	CollectdPort     int
	CollectdDatabase string
	CollectdTypesDB  string

	UdpServers []UdpInputConfig

	StorageDefaultEngine        string
	StorageMaxOpenShards        int
	StoragePointBatchSize       int
	StorageWriteBatchSize       int
	StorageEngineConfigs        map[string]toml.Primitive
	StorageRetentionSweepPeriod duration

	// TODO: this is for backward compatability only
	LevelDbMaxOpenFiles int
	LevelDbLruCacheSize int

	RaftServerPort               int
	RaftTimeout                  duration
	SeedServers                  []string
	DataDir                      string
	RaftDir                      string
	ProtobufPort                 int
	ProtobufTimeout              duration
	ProtobufHeartbeatInterval    duration
	ProtobufMinBackoff           duration
	ProtobufMaxBackoff           duration
	Hostname                     string
	LogFile                      string
	LogLevel                     string
	BindAddress                  string
	WalDir                       string
	WalFlushAfterRequests        int
	WalBookmarkAfterRequests     int
	WalIndexAfterRequests        int
	WalRequestsPerLogFile        int
	LocalStoreWriteBufferSize    int
	PerServerWriteBufferSize     int
	ClusterMaxResponseBufferSize int
	ConcurrentShardQueryLimit    int
	ReportingDisabled            bool
	Version                      string
	InfluxDBVersion              string
}

func LoadConfiguration

func LoadConfiguration(fileName string) (*Configuration, error)

func (*Configuration) AdminHttpPortString

func (self *Configuration) AdminHttpPortString() string

func (*Configuration) ApiHttpPortString

func (self *Configuration) ApiHttpPortString() string

func (*Configuration) ApiHttpSslPortString

func (self *Configuration) ApiHttpSslPortString() string

func (*Configuration) CollectdBindString added in v0.8.5

func (self *Configuration) CollectdBindString() string

func (*Configuration) GraphiteBindString added in v0.8.5

func (self *Configuration) GraphiteBindString() string

func (*Configuration) HostnameOrDetect

func (self *Configuration) HostnameOrDetect() string

func (*Configuration) ProtobufConnectionString

func (self *Configuration) ProtobufConnectionString() string

func (*Configuration) ProtobufListenString

func (self *Configuration) ProtobufListenString() string

func (*Configuration) RaftConnectionString

func (self *Configuration) RaftConnectionString() string

func (*Configuration) RaftListenString

func (self *Configuration) RaftListenString() string

func (*Configuration) UdpInputPortString

func (self *Configuration) UdpInputPortString(port int) string

type GraphiteConfig

type GraphiteConfig struct {
	Enabled    bool
	Address    string
	Port       int
	Database   string
	UdpEnabled bool `toml:"udp_enabled"`
}

type InputPlugins

type InputPlugins struct {
	Graphite        GraphiteConfig      `toml:"graphite"`
	CollectdInput   CollectdInputConfig `toml:"collectd"`
	UdpInput        UdpInputConfig      `toml:"udp"`
	UdpServersInput []UdpInputConfig    `toml:"udp_servers"`
}

type LevelDbConfiguration

type LevelDbConfiguration struct {
	MaxOpenFiles int  `toml:"max-open-files"`
	LruCacheSize Size `toml:"lru-cache-size"`

	// global configuration, use these values if the values in
	// StorageConfig aren't set
	MaxOpenShards  int `toml:"max-open-shards"`
	PointBatchSize int `toml:"point-batch-size"`
	WriteBatchSize int `toml:"write-batch-size"`
}

type LoggingConfig

type LoggingConfig struct {
	File  string
	Level string
}

type RaftConfig

type RaftConfig struct {
	Port    int
	Dir     string
	Timeout duration `toml:"election-timeout"`
}

type Size

type Size int

func (*Size) UnmarshalText

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

type StorageConfig

type StorageConfig struct {
	Dir                  string
	DefaultEngine        string `toml:"default-engine"`
	WriteBufferSize      int    `toml:"write-buffer-size"`
	MaxOpenShards        int    `toml:"max-open-shards"`
	PointBatchSize       int    `toml:"point-batch-size"`
	WriteBatchSize       int    `toml:"write-batch-size"`
	Engines              map[string]toml.Primitive
	RetentionSweepPeriod duration `toml:"retention-sweep-period"`
}

type TomlConfiguration

type TomlConfiguration struct {
	Admin             AdminConfig
	HttpApi           ApiConfig    `toml:"api"`
	InputPlugins      InputPlugins `toml:"input_plugins"`
	Raft              RaftConfig
	Storage           StorageConfig
	Cluster           ClusterConfig
	Logging           LoggingConfig
	Hostname          string
	BindAddress       string    `toml:"bind-address"`
	ReportingDisabled bool      `toml:"reporting-disabled"`
	WalConfig         WalConfig `toml:"wal"`
	LevelDb           LevelDbConfiguration
}

type UdpInputConfig

type UdpInputConfig struct {
	Enabled  bool
	Port     int
	Database string
}

type WalConfig

type WalConfig struct {
	Dir                   string `toml:"dir"`
	FlushAfterRequests    int    `toml:"flush-after"`
	BookmarkAfterRequests int    `toml:"bookmark-after"`
	IndexAfterRequests    int    `toml:"index-after"`
	RequestsPerLogFile    int    `toml:"requests-per-log-file"`
}

Jump to

Keyboard shortcuts

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