// Reset resets all metrics in this collector to 0.
func (d *DefaultMetricCollector) Reset() {
	d.NumRequests = rolling.NewNumber()
	d.Errors = rolling.NewNumber()
	d.Successes = rolling.NewNumber()
	d.Rejects = rolling.NewNumber()
	d.ShortCircuits = rolling.NewNumber()
	d.Failures = rolling.NewNumber()
	d.Timeouts = rolling.NewNumber()
	d.FallbackSuccesses = rolling.NewNumber()
	d.FallbackFailures = rolling.NewNumber()
	d.TotalDuration = rolling.NewTiming()
	d.RunDuration = rolling.NewTiming()
}
Esempio n. 2
0
// Reset resets all metrics in this collector to 0.
func (d *DefaultMetricCollector) Reset() {
	d.mutex.Lock()
	defer d.mutex.Unlock()

	d.numRequests = rolling.NewNumber()
	d.errors = rolling.NewNumber()
	d.successes = rolling.NewNumber()
	d.rejects = rolling.NewNumber()
	d.shortCircuits = rolling.NewNumber()
	d.failures = rolling.NewNumber()
	d.timeouts = rolling.NewNumber()
	d.fallbackSuccesses = rolling.NewNumber()
	d.fallbackFailures = rolling.NewNumber()
	d.totalDuration = rolling.NewTiming()
	d.runDuration = rolling.NewTiming()
}