Documentation ¶
Index ¶
- Constants
- func AsBatch(msg *metrics_pb.MetricsMessage) (*influxdb.BatchPoints, error)
- func LoadInfluxConfig(src map[interface{}]interface{}) (*influxConfig, error)
- func LoadOutputFileConfig(src map[interface{}]interface{}) (*outputfileConfig, error)
- type Config
- type Formatter
- type Gauge
- type Handler
- type HandlerType
- type Histogram
- type IntervalCounter
- type JsonFormatter
- type Meter
- type Metric
- type PlainTextFormatter
- type Registry
- type Timer
- type UsageRegistry
Constants ¶
const (
DefaultMetricsReportInterval = 15 * time.Second
)
Variables ¶
This section is empty.
Functions ¶
func AsBatch ¶
func AsBatch(msg *metrics_pb.MetricsMessage) (*influxdb.BatchPoints, error)
func LoadInfluxConfig ¶
func LoadInfluxConfig(src map[interface{}]interface{}) (*influxConfig, error)
func LoadOutputFileConfig ¶ added in v0.13.1
func LoadOutputFileConfig(src map[interface{}]interface{}) (*outputfileConfig, error)
Types ¶
type Config ¶
type Config struct { Handlers []Handler Source string Tags map[string]string ReportInterval time.Duration }
func LoadConfig ¶
type Formatter ¶ added in v0.13.1
type Formatter interface {
WriteTo(msg *metrics_pb.MetricsMessage, out io.Writer) error
}
type Gauge ¶ added in v0.14.23
type Gauge interface { metrics.Gauge Metric }
Gauge represents a metric which is measuring a count and a rate
type Handler ¶
type Handler interface { // AcceptMetrics is called when new metrics become available AcceptMetrics(message *metrics_pb.MetricsMessage) }
Handler represents a sink for metric events
func NewInfluxDBMetricsHandler ¶
NewInfluxDBMetricsHandler creates a new HandlerTypeInfluxDB metrics ChannelReporter
func NewOutputFileMetricsHandler ¶ added in v0.13.1
Message handler that write node and link metrics to a file in json format
type HandlerType ¶
type HandlerType string
HandlerType is used to define known handler types
const ( HandlerTypeInfluxDB HandlerType = "influxdb" HandlerTypeJSONFile HandlerType = "jsonfile" HandlerTypeFile HandlerType = "file" )
type Histogram ¶
Histogram represents a metric which is measuring the distribution of values for some measurement
type IntervalCounter ¶
IntervalCounter allows tracking counters which are bucketized by some interval
type JsonFormatter ¶ added in v0.13.1
type JsonFormatter struct{}
func (*JsonFormatter) WriteTo ¶ added in v0.13.1
func (formatter *JsonFormatter) WriteTo(msg *metrics_pb.MetricsMessage, out io.Writer) error
type Metric ¶
type Metric interface {
Dispose()
}
Metric is the base functionality for all metrics types
type PlainTextFormatter ¶ added in v0.13.1
type PlainTextFormatter struct { }
func (PlainTextFormatter) WriteTo ¶ added in v0.13.1
func (PlainTextFormatter) WriteTo(msg *metrics_pb.MetricsMessage, out io.Writer) error
type Registry ¶
type Registry interface { SourceId() string Gauge(name string) Gauge FuncGauge(name string, f func() int64) Gauge Meter(name string) Meter Histogram(name string) Histogram Timer(name string) Timer EachMetric(visitor func(name string, metric Metric)) IsValidMetric(name string) bool Poll() *metrics_pb.MetricsMessage DisposeAll() }
Registry allows for configuring and accessing metrics for a fabric application
type UsageRegistry ¶ added in v0.13.1
type UsageRegistry interface { Registry PollWithoutUsageMetrics() *metrics_pb.MetricsMessage IntervalCounter(name string, intervalSize time.Duration) IntervalCounter FlushToHandler(handler Handler) Flush() StartReporting(eventSink Handler, reportInterval time.Duration, msgQueueSize int) }
UsageRegistry extends registry to allow collecting usage metrics
func NewUsageRegistry ¶ added in v0.13.1
func NewUsageRegistry(sourceId string, tags map[string]string, closeNotify <-chan struct{}) UsageRegistry