Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultBindAddress is the default binding interface if none is specified. DefaultBindAddress = ":2003" // DefaultDatabase is the default database if none is specified. DefaultDatabase = "graphite" // DefaultProtocol is the default IP protocol used by the Graphite input. DefaultProtocol = "tcp" // DefaultConsistencyLevel is the default write consistency for the Graphite input. DefaultConsistencyLevel = "one" // DefaultSeparator is the default join character to use when joining multiple // measurment parts in a template. DefaultSeparator = "." // DefaultBatchSize is the default write batch size. DefaultBatchSize = 5000 // DefaultBatchPending is the default number of pending write batches. DefaultBatchPending = 10 // DefaultBatchTimeout is the default Graphite batch timeout. DefaultBatchTimeout = time.Second // DefaultUDPReadBuffer is the default buffer size for the UDP listener. // Sets the size of the operating system's receive buffer associated with // the UDP traffic. Keep in mind that the OS must be able // to handle the number set here or the UDP listener will error and exit. // // DefaultReadBuffer = 0 means to use the OS default, which is usually too // small for high UDP performance. // // Increasing OS buffer limits: // Linux: sudo sysctl -w net.core.rmem_max=<read-buffer> // BSD/Darwin: sudo sysctl -w kern.ipc.maxsockbuf=<read-buffer> DefaultUDPReadBuffer = 0 )
Variables ¶
View Source
var ( MinDate = time.Date(1901, 12, 13, 0, 0, 0, 0, time.UTC) MaxDate = time.Date(2038, 1, 19, 0, 0, 0, 0, time.UTC) )
Minimum and maximum supported dates for timestamps.
Functions ¶
Types ¶
type Config ¶
type Config struct { BindAddress string `toml:"bind-address"` Database string `toml:"database"` Enabled bool `toml:"enabled"` Protocol string `toml:"protocol"` BatchSize int `toml:"batch-size"` BatchPending int `toml:"batch-pending"` BatchTimeout toml.Duration `toml:"batch-timeout"` ConsistencyLevel string `toml:"consistency-level"` Templates []string `toml:"templates"` Tags []string `toml:"tags"` Separator string `toml:"separator"` UDPReadBuffer int `toml:"udp-read-buffer"` }
Config represents the configuration for Graphite endpoints.
func (*Config) DefaultTags ¶ added in v0.9.1
DefaultTags returns the config's tags.
func (*Config) WithDefaults ¶
WithDefaults takes the given config and returns a new config with any required default values set.
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser encapsulates a Graphite Parser.
func NewParserWithOptions ¶ added in v0.9.1
NewParserWithOptions returns a graphite parser using the given options
func (*Parser) ApplyTemplate ¶ added in v0.9.5
ApplyTemplate extracts the template fields from the given line and returns the measurement name and tags.
type Service ¶
type Service struct { Monitor interface { RegisterDiagnosticsClient(name string, client monitor.DiagsClient) DeregisterDiagnosticsClient(name string) } PointsWriter interface { WritePoints(p *cluster.WritePointsRequest) error } MetaStore interface { WaitForLeader(d time.Duration) error CreateDatabaseIfNotExists(name string) (*meta.DatabaseInfo, error) } // contains filtered or unexported fields }
Service represents a Graphite service.
func NewService ¶
NewService returns an instance of the Graphite service.
func (*Service) Diagnostics ¶ added in v0.9.5
func (s *Service) Diagnostics() (*monitor.Diagnostic, error)
Diagnostics returns diagnostics of the graphite service.
type UnsupposedValueError ¶ added in v0.9.6
An UnsupposedValueError is returned when a parsed value is not supposed.
func (*UnsupposedValueError) Error ¶ added in v0.9.6
func (err *UnsupposedValueError) Error() string
Click to show internal directories.
Click to hide internal directories.