Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// User config.
Conf *Config
// Local config.
Lc *LocalConfig
// Pointer to Monitoring structure.
Mon *Monitoring
// contains filtered or unexported fields
}
Client is a class wich sends metrics to the carbon receivers
type Config ¶
type Config struct {
// Supervisor manager which is used to run Grafsy. e.g. systemd.
// Default is none.
Supervisor string
// The interval, after which client will send data to graphite. In seconds.
ClientSendInterval int
// Maximum amount of metrics which can be processed per second.
// In case of problems with connection/amount of metrics,
// this configuration will take save up to maxMetrics*clientSendInterval metrics in.
MetricsPerSecond int
// Real Carbon servers to which client will send all data
CarbonAddrs []string
// Timeout for connecting to graphiteAddr.
// Timeout for writing metrics themselves will be clientSendInterval-connectTimeout-1.
// Default 7. In seconds.
ConnectTimeout int
// Local address:port for local daemon.
LocalBind string
// Main log file.
Log string
// Directory, in which developers/admins... can write any file with metrics.
MetricDir string
// Enables ACL for metricDir to let grafsy read files there with any permissions.
// Default is false.
UseACL bool
// Data, which was not sent will be buffered in this directory.
RetryDir string
// Prefix for metric to sum.
// Do not forget to include it in allowedMetrics if you change it.
SumPrefix string
// Prefix for metric to calculate average.
// Do not forget to include it in allowedMetrics if you change it.
AvgPrefix string
// Prefix for metric to find minimal value.
// Do not forget to include it in allowedMetrics if you change it.
MinPrefix string
// Prefix for metric to find maximum value.
// Do not forget to include it in allowedMetrics if you change it.
MaxPrefix string
// Summing up interval for metrics with all prefixes. In seconds.
AggrInterval int
// Amount of aggregations which grafsy performs per second.
// If grafsy receives more metrics than aggrPerSecond*aggrInterval - rest will be dropped.
AggrPerSecond int
// Alias to use instead of os.Hostname() result
Hostname string
// Full path for metrics, send by grafsy itself.
// "HOSTNAME" will be replaced with os.Hostname() result from GO.
// Default is "HOSTNAME"
MonitoringPath string
// Regexp of allowed metric.
// Every metric which is not passing check against regexp will be removed.
AllowedMetrics string
// List of metrics to overwrite
Overwrite []struct {
// Regexp of metric to replace from config
ReplaceWhatRegexp string
// New metric part
ReplaceWith string
}
}
Config is the main config specified by user.
func (*Config) GenerateLocalConfig ¶
func (conf *Config) GenerateLocalConfig() (*LocalConfig, error)
GenerateLocalConfig generates LocalConfig with all needed for running server variables based on Config.
func (*Config) LoadConfig ¶
LoadConfig loads a configFile to a Config structure.
type LocalConfig ¶
type LocalConfig struct {
// contains filtered or unexported fields
}
LocalConfig is generated based on Config.
type Monitoring ¶
type Monitoring struct {
// User config.
Conf *Config
// Local config.
Lc *LocalConfig
// contains filtered or unexported fields
}
Monitoring structure. Based on this self-monitoring will be sent to Graphite.
func (*Monitoring) Increase ¶
func (m *Monitoring) Increase(metric *int, value int)
Increase metric value in the thread safe way
func (*Monitoring) Run ¶
func (m *Monitoring) Run()
Run monitoring. Should be run in separate goroutine.
type Server ¶
type Server struct {
// User config.
Conf *Config
// Local config.
Lc *LocalConfig
// Pointer to Monitoring structure.
Mon *Monitoring
}
The Server class to receive a data
Source Files
¶
Click to show internal directories.
Click to hide internal directories.


