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 { Enabled bool `toml:"enabled"` BindAddress string `toml:"bind-address"` Database string `toml:"database"` 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 ¶
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 ¶
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 diagnostics.Client) DeregisterDiagnosticsClient(name string) } PointsWriter interface { WritePoints(database, retentionPolicy string, consistencyLevel models.ConsistencyLevel, points []models.Point) error } MetaClient interface { CreateDatabase(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() (*diagnostics.Diagnostics, error)
Diagnostics returns diagnostics of the graphite service.
type UnsupportedValueError ¶ added in v0.12.0
An UnsupportedValueError is returned when a parsed value is not supported.
func (*UnsupportedValueError) Error ¶ added in v0.12.0
func (err *UnsupportedValueError) Error() string
Click to show internal directories.
Click to hide internal directories.