Documentation
¶
Index ¶
- func GetMetricString(metric Metric) string
- type CollectdMetric
- func (metric CollectdMetric) GetAppName() string
- func (metric CollectdMetric) GetCriterias() map[string]string
- func (metric CollectdMetric) GetDuration() time.Duration
- func (metric CollectdMetric) GetHost() string
- func (metric CollectdMetric) GetMeasurementName() string
- func (metric CollectdMetric) GetType() MetricDataType
- type CollectdMetricSource
- type CollectdMetricWriter
- type MemoryMetricRing
- type MemoryMetricStorage
- func (self *MemoryMetricStorage) AddMetricValue(m Metric, val MetricValue) error
- func (self *MemoryMetricStorage) CountMetrics() int32
- func (self *MemoryMetricStorage) CountValues(m Metric) (int64, error)
- func (self *MemoryMetricStorage) DeleteMetricValue(val MetricValue) bool
- func (self *MemoryMetricStorage) Flush() bool
- func (self *MemoryMetricStorage) GetAllMetrics() ([]Metric, error)
- func (self *MemoryMetricStorage) GetFullName() string
- func (self *MemoryMetricStorage) GetLastMetricValue(m Metric) (MetricValue, error)
- func (self *MemoryMetricStorage) GetLastMetricValues(m Metric, n_skip int, n_get int) ([]MetricValue, error)
- func (self *MemoryMetricStorage) GetMetricByName(name string) (Metric, error)
- func (self *MemoryMetricStorage) GetMetricValueByTimeRange(m Metric, since time.Time, duration time.Duration) ([]MetricValue, error)
- func (self *MemoryMetricStorage) GetMetricsByHost(host_name string) ([]Metric, error)
- func (self *MemoryMetricStorage) GetName() string
- func (self *MemoryMetricStorage) IsLimited() bool
- func (self *MemoryMetricStorage) IsMemory() bool
- type Metric
- type MetricDataType
- type MetricSource
- type MetricStorage
- type MetricValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMetricString ¶
Types ¶
type CollectdMetric ¶
type CollectdMetric struct { api.Identifier DSName string DataType MetricDataType Interval time.Duration }
func (CollectdMetric) GetAppName ¶
func (metric CollectdMetric) GetAppName() string
func (CollectdMetric) GetCriterias ¶
func (metric CollectdMetric) GetCriterias() map[string]string
func (CollectdMetric) GetDuration ¶
func (metric CollectdMetric) GetDuration() time.Duration
func (CollectdMetric) GetHost ¶
func (metric CollectdMetric) GetHost() string
func (CollectdMetric) GetMeasurementName ¶
func (metric CollectdMetric) GetMeasurementName() string
func (CollectdMetric) GetType ¶
func (metric CollectdMetric) GetType() MetricDataType
type CollectdMetricSource ¶
type CollectdMetricSource struct {
// contains filtered or unexported fields
}
func NewCollectdMetricSource ¶
func NewCollectdMetricSource(listen_host string, listen_port uint16, filter_enable bool, filter_types []string) *CollectdMetricSource
func (*CollectdMetricSource) AddStorage ¶
func (self *CollectdMetricSource) AddStorage(store MetricStorage) bool
func (*CollectdMetricSource) Collect ¶
func (self *CollectdMetricSource) Collect() error
func (*CollectdMetricSource) FlushToStorage ¶
func (self *CollectdMetricSource) FlushToStorage() bool
type CollectdMetricWriter ¶
type CollectdMetricWriter struct {
// contains filtered or unexported fields
}
type MemoryMetricRing ¶
type MemoryMetricStorage ¶
func NewMemoryStorage ¶
func NewMemoryStorage(capacity int) *MemoryMetricStorage
func (*MemoryMetricStorage) AddMetricValue ¶
func (self *MemoryMetricStorage) AddMetricValue(m Metric, val MetricValue) error
func (*MemoryMetricStorage) CountMetrics ¶
func (self *MemoryMetricStorage) CountMetrics() int32
func (*MemoryMetricStorage) CountValues ¶
func (self *MemoryMetricStorage) CountValues(m Metric) (int64, error)
func (*MemoryMetricStorage) DeleteMetricValue ¶
func (self *MemoryMetricStorage) DeleteMetricValue(val MetricValue) bool
func (*MemoryMetricStorage) Flush ¶
func (self *MemoryMetricStorage) Flush() bool
func (*MemoryMetricStorage) GetAllMetrics ¶
func (self *MemoryMetricStorage) GetAllMetrics() ([]Metric, error)
func (*MemoryMetricStorage) GetFullName ¶
func (self *MemoryMetricStorage) GetFullName() string
func (*MemoryMetricStorage) GetLastMetricValue ¶
func (self *MemoryMetricStorage) GetLastMetricValue(m Metric) (MetricValue, error)
func (*MemoryMetricStorage) GetLastMetricValues ¶
func (self *MemoryMetricStorage) GetLastMetricValues(m Metric, n_skip int, n_get int) ([]MetricValue, error)
func (*MemoryMetricStorage) GetMetricByName ¶
func (self *MemoryMetricStorage) GetMetricByName(name string) (Metric, error)
func (*MemoryMetricStorage) GetMetricValueByTimeRange ¶
func (self *MemoryMetricStorage) GetMetricValueByTimeRange(m Metric, since time.Time, duration time.Duration) ([]MetricValue, error)
func (*MemoryMetricStorage) GetMetricsByHost ¶
func (self *MemoryMetricStorage) GetMetricsByHost(host_name string) ([]Metric, error)
func (*MemoryMetricStorage) GetName ¶
func (self *MemoryMetricStorage) GetName() string
func (*MemoryMetricStorage) IsLimited ¶
func (self *MemoryMetricStorage) IsLimited() bool
func (*MemoryMetricStorage) IsMemory ¶
func (self *MemoryMetricStorage) IsMemory() bool
type Metric ¶
type Metric interface { //Returns metric application name GetAppName() string //Returns host metric belnogs to GetHost() string //Returns map of string measurement criterias parameters GetCriterias() map[string]string //Returns measurement series name //In most cases it measurement series name which describes source of information GetMeasurementName() string //Returns metric data type GetType() MetricDataType //Get metric duraiton GetDuration() time.Duration }
Metric data interface
type MetricDataType ¶
type MetricDataType int16
const ( METRIC_GAUGE MetricDataType = 0 METRIC_DERIVE MetricDataType = 1 METRIC_COUNTER MetricDataType = 2 METRIC_ABSOLUTE MetricDataType = 3 )
type MetricSource ¶
type MetricSource interface { AddStorage(store MetricStorage) bool FlushToStorage() bool Collect() error }
type MetricStorage ¶
type MetricStorage interface { AddMetricValue(m Metric, val MetricValue) error DeleteMetricValue(val MetricValue) bool GetLastMetricValue(m Metric) (MetricValue, error) GetLastMetricValues(m Metric, n_skip int, n_get int) ([]MetricValue, error) GetMetricValueByTimeRange(m Metric, since time.Time, duration time.Duration) ([]MetricValue, error) GetAllMetrics() ([]Metric, error) GetMetricByName(name string) (Metric, error) GetMetricsByHost(host_name string) ([]Metric, error) CountValues(m Metric) (int64, error) CountMetrics() int32 GetName() string GetFullName() string IsMemory() bool IsLimited() bool Flush() bool }
type MetricValue ¶
type MetricValue struct { Name string Time time.Time Kind MetricDataType ValueType reflect.Type Value interface{} }
func DeriveMetricValues ¶
func DeriveMetricValues(values []MetricValue, non_negative bool) ([]MetricValue, error)
Click to show internal directories.
Click to hide internal directories.