Documentation
¶
Index ¶
- type Client
- type Log
- func (c *Log) BuildTimer() timer.Timer
- func (c *Log) Close() error
- func (c *Log) GetHTTPMetricCallback() bucket.HTTPMetricNameAlterCallback
- func (c *Log) Handler() http.Handler
- func (c *Log) ResetHTTPRequestSection() Client
- func (c *Log) SetHTTPMetricCallback(callback bucket.HTTPMetricNameAlterCallback) Client
- func (c *Log) SetHTTPRequestSection(section string) Client
- func (c *Log) TrackMetric(section string, operation *bucket.MetricOperation) Client
- func (c *Log) TrackMetricN(section string, operation *bucket.MetricOperation, n int) Client
- func (c *Log) TrackOperation(section string, operation *bucket.MetricOperation, t timer.Timer, success bool) Client
- func (c *Log) TrackOperationN(section string, operation *bucket.MetricOperation, t timer.Timer, n int, ...) Client
- func (c *Log) TrackRequest(r *http.Request, t timer.Timer, success bool) Client
- func (c *Log) TrackState(section string, operation *bucket.MetricOperation, value int) Client
- type Memory
- func (c *Memory) BuildTimer() timer.Timer
- func (c *Memory) Close() error
- func (c *Memory) GetHTTPMetricCallback() bucket.HTTPMetricNameAlterCallback
- func (c *Memory) Handler() http.Handler
- func (c *Memory) ResetHTTPRequestSection() Client
- func (c *Memory) SetHTTPMetricCallback(callback bucket.HTTPMetricNameAlterCallback) Client
- func (c *Memory) SetHTTPRequestSection(section string) Client
- func (c *Memory) TrackMetric(section string, operation *bucket.MetricOperation) Client
- func (c *Memory) TrackMetricN(section string, operation *bucket.MetricOperation, n int) Client
- func (c *Memory) TrackOperation(section string, operation *bucket.MetricOperation, t timer.Timer, success bool) Client
- func (c *Memory) TrackOperationN(section string, operation *bucket.MetricOperation, t timer.Timer, n int, ...) Client
- func (c *Memory) TrackRequest(r *http.Request, t timer.Timer, success bool) Client
- func (c *Memory) TrackState(section string, operation *bucket.MetricOperation, value int) Client
- type Metric
- type Noop
- func (c *Noop) BuildTimer() timer.Timer
- func (c *Noop) Close() error
- func (c *Noop) GetHTTPMetricCallback() bucket.HTTPMetricNameAlterCallback
- func (c *Noop) Handler() http.Handler
- func (c *Noop) ResetHTTPRequestSection() Client
- func (c *Noop) SetHTTPMetricCallback(callback bucket.HTTPMetricNameAlterCallback) Client
- func (c *Noop) SetHTTPRequestSection(section string) Client
- func (c *Noop) TrackMetric(section string, operation *bucket.MetricOperation) Client
- func (c *Noop) TrackMetricN(section string, operation *bucket.MetricOperation, n int) Client
- func (c *Noop) TrackOperation(section string, operation *bucket.MetricOperation, t timer.Timer, success bool) Client
- func (c *Noop) TrackOperationN(section string, operation *bucket.MetricOperation, t timer.Timer, n int, ...) Client
- func (c *Noop) TrackRequest(r *http.Request, t timer.Timer, success bool) Client
- func (c *Noop) TrackState(section string, operation *bucket.MetricOperation, value int) Client
- type Prometheus
- func (c *Prometheus) BuildTimer() timer.Timer
- func (c *Prometheus) Close() error
- func (c *Prometheus) GetHTTPMetricCallback() bucket.HTTPMetricNameAlterCallback
- func (c *Prometheus) Handler() http.Handler
- func (c *Prometheus) ResetHTTPRequestSection() Client
- func (c *Prometheus) SetHTTPMetricCallback(callback bucket.HTTPMetricNameAlterCallback) Client
- func (c *Prometheus) SetHTTPRequestSection(section string) Client
- func (c *Prometheus) TrackMetric(section string, operation *bucket.MetricOperation) Client
- func (c *Prometheus) TrackMetricN(section string, operation *bucket.MetricOperation, n int) Client
- func (c *Prometheus) TrackOperation(section string, operation *bucket.MetricOperation, t timer.Timer, success bool) Client
- func (c *Prometheus) TrackOperationN(section string, operation *bucket.MetricOperation, t timer.Timer, n int, ...) Client
- func (c *Prometheus) TrackRequest(r *http.Request, t timer.Timer, success bool) Client
- func (c *Prometheus) TrackState(section string, operation *bucket.MetricOperation, value int) Client
- type StatsD
- func (c *StatsD) BuildTimer() timer.Timer
- func (c *StatsD) Close() error
- func (c *StatsD) GetHTTPMetricCallback() bucket.HTTPMetricNameAlterCallback
- func (c *StatsD) Handler() http.Handler
- func (c *StatsD) ResetHTTPRequestSection() Client
- func (c *StatsD) SetHTTPMetricCallback(callback bucket.HTTPMetricNameAlterCallback) Client
- func (c *StatsD) SetHTTPRequestSection(section string) Client
- func (c *StatsD) TrackMetric(section string, operation *bucket.MetricOperation) Client
- func (c *StatsD) TrackMetricN(section string, operation *bucket.MetricOperation, n int) Client
- func (c *StatsD) TrackOperation(section string, operation *bucket.MetricOperation, t timer.Timer, success bool) Client
- func (c *StatsD) TrackOperationN(section string, operation *bucket.MetricOperation, t timer.Timer, n int, ...) Client
- func (c *StatsD) TrackRequest(r *http.Request, t timer.Timer, success bool) Client
- func (c *StatsD) TrackState(section string, operation *bucket.MetricOperation, value int) Client
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
// BuildTimer builds timer to track metric timings
BuildTimer() timer.Timer
// Close closes underlying client connection if any
Close() error
// TrackRequest tracks HTTP Request stats
TrackRequest(r *http.Request, t timer.Timer, success bool) Client
// TrackOperation tracks custom operation
TrackOperation(section string, operation *bucket.MetricOperation, t timer.Timer, success bool) Client
// TrackOperationN tracks custom operation with n diff
TrackOperationN(section string, operation *bucket.MetricOperation, t timer.Timer, n int, success bool) Client
// TrackMetric tracks custom metric, w/out ok/fail additional sections
TrackMetric(section string, operation *bucket.MetricOperation) Client
// TrackMetricN tracks custom metric with n diff, w/out ok/fail additional sections
TrackMetricN(section string, operation *bucket.MetricOperation, n int) Client
// TrackState tracks metric absolute value
TrackState(section string, operation *bucket.MetricOperation, value int) Client
// SetHTTPMetricCallback sets callback handler that allows metric operation alteration for HTTP Request
SetHTTPMetricCallback(callback bucket.HTTPMetricNameAlterCallback) Client
// GetHTTPMetricCallback gets callback handler that allows metric operation alteration for HTTP Request
GetHTTPMetricCallback() bucket.HTTPMetricNameAlterCallback
// SetHTTPRequestSection sets metric section for HTTP Request metrics
SetHTTPRequestSection(section string) Client
// ResetHTTPRequestSection resets metric section for HTTP Request metrics to default value that is "request"
ResetHTTPRequestSection() Client
// Handler returns metrics endpoint for prometheus backend
Handler() http.Handler
}
Client is an interface for different methods of gathering stats
type Log ¶
Log is Client implementation for debug log
func (*Log) BuildTimer ¶
BuildTimer builds timer to track metric timings
func (*Log) GetHTTPMetricCallback ¶
func (c *Log) GetHTTPMetricCallback() bucket.HTTPMetricNameAlterCallback
GetHTTPMetricCallback gets callback handler that allows metric operation alteration for HTTP Request
func (*Log) ResetHTTPRequestSection ¶
ResetHTTPRequestSection resets metric section for HTTP Request metrics to default value that is "request"
func (*Log) SetHTTPMetricCallback ¶
func (c *Log) SetHTTPMetricCallback(callback bucket.HTTPMetricNameAlterCallback) Client
SetHTTPMetricCallback sets callback handler that allows metric operation alteration for HTTP Request
func (*Log) SetHTTPRequestSection ¶
SetHTTPRequestSection sets metric section for HTTP Request metrics
func (*Log) TrackMetric ¶
func (c *Log) TrackMetric(section string, operation *bucket.MetricOperation) Client
TrackMetric tracks custom metric, w/out ok/fail additional sections
func (*Log) TrackMetricN ¶
TrackMetricN tracks custom metric with n diff, w/out ok/fail additional sections
func (*Log) TrackOperation ¶
func (c *Log) TrackOperation(section string, operation *bucket.MetricOperation, t timer.Timer, success bool) Client
TrackOperation tracks custom operation
func (*Log) TrackOperationN ¶
func (c *Log) TrackOperationN(section string, operation *bucket.MetricOperation, t timer.Timer, n int, success bool) Client
TrackOperationN tracks custom operation with n diff
func (*Log) TrackRequest ¶
TrackRequest tracks HTTP Request stats
func (*Log) TrackState ¶
TrackState tracks metric absolute value
type Memory ¶
type Memory struct {
sync.Mutex
TimerMetrics []Metric
CountMetrics map[string]int
StateMetrics map[string]int
// contains filtered or unexported fields
}
Memory is Client implementation for tests
func (*Memory) BuildTimer ¶
BuildTimer builds timer to track metric timings
func (*Memory) GetHTTPMetricCallback ¶
func (c *Memory) GetHTTPMetricCallback() bucket.HTTPMetricNameAlterCallback
GetHTTPMetricCallback gets callback handler that allows metric operation alteration for HTTP Request
func (*Memory) ResetHTTPRequestSection ¶
ResetHTTPRequestSection resets metric section for HTTP Request metrics to default value that is "request"
func (*Memory) SetHTTPMetricCallback ¶
func (c *Memory) SetHTTPMetricCallback(callback bucket.HTTPMetricNameAlterCallback) Client
SetHTTPMetricCallback sets callback handler that allows metric operation alteration for HTTP Request
func (*Memory) SetHTTPRequestSection ¶
SetHTTPRequestSection sets metric section for HTTP Request metrics
func (*Memory) TrackMetric ¶
func (c *Memory) TrackMetric(section string, operation *bucket.MetricOperation) Client
TrackMetric tracks custom metric, w/out ok/fail additional sections
func (*Memory) TrackMetricN ¶
TrackMetricN tracks custom metric with n diff, w/out ok/fail additional sections
func (*Memory) TrackOperation ¶
func (c *Memory) TrackOperation(section string, operation *bucket.MetricOperation, t timer.Timer, success bool) Client
TrackOperation tracks custom operation
func (*Memory) TrackOperationN ¶
func (c *Memory) TrackOperationN(section string, operation *bucket.MetricOperation, t timer.Timer, n int, success bool) Client
TrackOperationN tracks custom operation with n diff
func (*Memory) TrackRequest ¶
TrackRequest tracks HTTP Request stats
func (*Memory) TrackState ¶
TrackState tracks metric absolute value
type Noop ¶
Noop is Client implementation that does literally nothing
func (*Noop) BuildTimer ¶
BuildTimer builds timer to track metric timings
func (*Noop) GetHTTPMetricCallback ¶
func (c *Noop) GetHTTPMetricCallback() bucket.HTTPMetricNameAlterCallback
GetHTTPMetricCallback gets callback handler that allows metric operation alteration for HTTP Request
func (*Noop) ResetHTTPRequestSection ¶
ResetHTTPRequestSection resets metric section for HTTP Request metrics to default value that is "request"
func (*Noop) SetHTTPMetricCallback ¶
func (c *Noop) SetHTTPMetricCallback(callback bucket.HTTPMetricNameAlterCallback) Client
SetHTTPMetricCallback sets callback handler that allows metric operation alteration for HTTP Request
func (*Noop) SetHTTPRequestSection ¶
SetHTTPRequestSection sets metric section for HTTP Request metrics
func (*Noop) TrackMetric ¶
func (c *Noop) TrackMetric(section string, operation *bucket.MetricOperation) Client
TrackMetric tracks custom metric, w/out ok/fail additional sections
func (*Noop) TrackMetricN ¶
TrackMetricN tracks custom metric with n diff, w/out ok/fail additional sections
func (*Noop) TrackOperation ¶
func (c *Noop) TrackOperation(section string, operation *bucket.MetricOperation, t timer.Timer, success bool) Client
TrackOperation tracks custom operation
func (*Noop) TrackOperationN ¶
func (c *Noop) TrackOperationN(section string, operation *bucket.MetricOperation, t timer.Timer, n int, success bool) Client
TrackOperationN tracks custom operation with n diff
func (*Noop) TrackRequest ¶
TrackRequest tracks HTTP Request stats
func (*Noop) TrackState ¶
TrackState tracks metric absolute value
type Prometheus ¶ added in v1.0.0
Prometheus is Client implementation for prometheus
func NewPrometheus ¶ added in v1.0.0
func NewPrometheus(namespace string, incFactory incrementer.Factory, stFactory state.Factory) *Prometheus
NewPrometheus builds and returns new Prometheus instance
func (*Prometheus) BuildTimer ¶ added in v1.0.0
func (c *Prometheus) BuildTimer() timer.Timer
BuildTimer builds timer to track metric timings
func (*Prometheus) Close ¶ added in v1.0.0
func (c *Prometheus) Close() error
Close closes underlying client connection if any
func (*Prometheus) GetHTTPMetricCallback ¶ added in v1.0.0
func (c *Prometheus) GetHTTPMetricCallback() bucket.HTTPMetricNameAlterCallback
GetHTTPMetricCallback gets callback handler that allows metric operation alteration for HTTP Request
func (*Prometheus) Handler ¶ added in v1.0.0
func (c *Prometheus) Handler() http.Handler
Handler returns metrics endpoint for prometheus backend
func (*Prometheus) ResetHTTPRequestSection ¶ added in v1.0.0
func (c *Prometheus) ResetHTTPRequestSection() Client
ResetHTTPRequestSection resets metric section for HTTP Request metrics to default value that is "request"
func (*Prometheus) SetHTTPMetricCallback ¶ added in v1.0.0
func (c *Prometheus) SetHTTPMetricCallback(callback bucket.HTTPMetricNameAlterCallback) Client
SetHTTPMetricCallback sets callback handler that allows metric operation alteration for HTTP Request
func (*Prometheus) SetHTTPRequestSection ¶ added in v1.0.0
func (c *Prometheus) SetHTTPRequestSection(section string) Client
SetHTTPRequestSection sets metric section for HTTP Request metrics
func (*Prometheus) TrackMetric ¶ added in v1.0.0
func (c *Prometheus) TrackMetric(section string, operation *bucket.MetricOperation) Client
TrackMetric tracks custom metric, w/out ok/fail additional sections
func (*Prometheus) TrackMetricN ¶ added in v1.0.0
func (c *Prometheus) TrackMetricN(section string, operation *bucket.MetricOperation, n int) Client
TrackMetricN tracks custom metric with n diff, w/out ok/fail additional sections
func (*Prometheus) TrackOperation ¶ added in v1.0.0
func (c *Prometheus) TrackOperation(section string, operation *bucket.MetricOperation, t timer.Timer, success bool) Client
TrackOperation tracks custom operation
func (*Prometheus) TrackOperationN ¶ added in v1.0.0
func (c *Prometheus) TrackOperationN(section string, operation *bucket.MetricOperation, t timer.Timer, n int, success bool) Client
TrackOperationN tracks custom operation with n diff
func (*Prometheus) TrackRequest ¶ added in v1.0.0
TrackRequest tracks HTTP Request stats
func (*Prometheus) TrackState ¶ added in v1.0.0
func (c *Prometheus) TrackState(section string, operation *bucket.MetricOperation, value int) Client
TrackState tracks metric absolute value
type StatsD ¶
StatsD is Client implementation for statsd
func (*StatsD) BuildTimer ¶
BuildTimer builds timer to track metric timings
func (*StatsD) GetHTTPMetricCallback ¶
func (c *StatsD) GetHTTPMetricCallback() bucket.HTTPMetricNameAlterCallback
GetHTTPMetricCallback gets callback handler that allows metric operation alteration for HTTP Request
func (*StatsD) ResetHTTPRequestSection ¶
ResetHTTPRequestSection resets metric section for HTTP Request metrics to default value that is "request"
func (*StatsD) SetHTTPMetricCallback ¶
func (c *StatsD) SetHTTPMetricCallback(callback bucket.HTTPMetricNameAlterCallback) Client
SetHTTPMetricCallback sets callback handler that allows metric operation alteration for HTTP Request
func (*StatsD) SetHTTPRequestSection ¶
SetHTTPRequestSection sets metric section for HTTP Request metrics
func (*StatsD) TrackMetric ¶
func (c *StatsD) TrackMetric(section string, operation *bucket.MetricOperation) Client
TrackMetric tracks custom metric, w/out ok/fail additional sections
func (*StatsD) TrackMetricN ¶
TrackMetricN tracks custom metric with n diff, w/out ok/fail additional sections
func (*StatsD) TrackOperation ¶
func (c *StatsD) TrackOperation(section string, operation *bucket.MetricOperation, t timer.Timer, success bool) Client
TrackOperation tracks custom operation
func (*StatsD) TrackOperationN ¶
func (c *StatsD) TrackOperationN(section string, operation *bucket.MetricOperation, t timer.Timer, n int, success bool) Client
TrackOperationN tracks custom operation with n diff
func (*StatsD) TrackRequest ¶
TrackRequest tracks HTTP Request stats
func (*StatsD) TrackState ¶
TrackState tracks metric absolute value