metricCollector

package
v0.0.0-...-fa1af6a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2018 License: MIT Imports: 3 Imported by: 155

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Registry = metricCollectorRegistry{
	// contains filtered or unexported fields
}

Registry is the default metricCollectorRegistry that circuits will use to collect statistics about the health of the circuit.

Functions

This section is empty.

Types

type DefaultMetricCollector

type DefaultMetricCollector struct {
	// contains filtered or unexported fields
}

DefaultMetricCollector holds information about the circuit state. This implementation of MetricCollector is the canonical source of information about the circuit. It is used for for all internal hystrix operations including circuit health checks and metrics sent to the hystrix dashboard.

Metric Collectors do not need Mutexes as they are updated by circuits within a locked context.

func (*DefaultMetricCollector) ContextCanceled

func (d *DefaultMetricCollector) ContextCanceled() *rolling.Number

func (*DefaultMetricCollector) ContextDeadlineExceeded

func (d *DefaultMetricCollector) ContextDeadlineExceeded() *rolling.Number

func (*DefaultMetricCollector) Errors

func (d *DefaultMetricCollector) Errors() *rolling.Number

Errors returns the rolling number of errors

func (*DefaultMetricCollector) Failures

func (d *DefaultMetricCollector) Failures() *rolling.Number

Failures returns the rolling number of failures

func (*DefaultMetricCollector) FallbackFailures

func (d *DefaultMetricCollector) FallbackFailures() *rolling.Number

FallbackFailures returns the rolling number of fallback failures

func (*DefaultMetricCollector) FallbackSuccesses

func (d *DefaultMetricCollector) FallbackSuccesses() *rolling.Number

FallbackSuccesses returns the rolling number of fallback successes

func (*DefaultMetricCollector) NumRequests

func (d *DefaultMetricCollector) NumRequests() *rolling.Number

NumRequests returns the rolling number of requests

func (*DefaultMetricCollector) Rejects

func (d *DefaultMetricCollector) Rejects() *rolling.Number

Rejects returns the rolling number of rejects

func (*DefaultMetricCollector) Reset

func (d *DefaultMetricCollector) Reset()

Reset resets all metrics in this collector to 0.

func (*DefaultMetricCollector) RunDuration

func (d *DefaultMetricCollector) RunDuration() *rolling.Timing

RunDuration returns the rolling run duration

func (*DefaultMetricCollector) ShortCircuits

func (d *DefaultMetricCollector) ShortCircuits() *rolling.Number

ShortCircuits returns the rolling number of short circuits

func (*DefaultMetricCollector) Successes

func (d *DefaultMetricCollector) Successes() *rolling.Number

Successes returns the rolling number of successes

func (*DefaultMetricCollector) Timeouts

func (d *DefaultMetricCollector) Timeouts() *rolling.Number

Timeouts returns the rolling number of timeouts

func (*DefaultMetricCollector) TotalDuration

func (d *DefaultMetricCollector) TotalDuration() *rolling.Timing

TotalDuration returns the rolling total duration

func (*DefaultMetricCollector) Update

func (d *DefaultMetricCollector) Update(r MetricResult)

type MetricCollector

type MetricCollector interface {
	// Update accepts a set of metrics from a command execution for remote instrumentation
	Update(MetricResult)
	// Reset resets the internal counters and timers.
	Reset()
}

MetricCollector represents the contract that all collectors must fulfill to gather circuit statistics. Implementations of this interface do not have to maintain locking around thier data stores so long as they are not modified outside of the hystrix context.

type MetricResult

type MetricResult struct {
	Attempts                float64
	Errors                  float64
	Successes               float64
	Failures                float64
	Rejects                 float64
	ShortCircuits           float64
	Timeouts                float64
	FallbackSuccesses       float64
	FallbackFailures        float64
	ContextCanceled         float64
	ContextDeadlineExceeded float64
	TotalDuration           time.Duration
	RunDuration             time.Duration
	ConcurrencyInUse        float64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL