Class: CBStats

CBStats

new CBStats(options)

Circuit breaker statistics

Parameters:
Name Type Description
options object
Properties
Name Type Description
timesLength integer

Amount of intervals to keep for call times statistics
(default: 60)

countsLength integer

Amount of intervals to keep for summarized counters
(default: 120)

healthLength integer

Amount of intervals to keep for the health summary
(default: 10)

Source:

Methods

add(intervals)

Add intervals emitted by the CircuitBreaker#event:interval event.

Parameters:
Name Type Description
intervals Array.<object>

Array of CircuitBreaker#event:interval instances

Source:

getSummary() → {CBStats~Summary}

Get statistics summary

Source:
Returns:

stats

Type
CBStats~Summary

Type Definitions

CountsSummary

Type:
  • object
Properties:
Name Type Description
total integer
success integer
totalErrors integer
errors object

Error counts by name

Source:

HealthSummary

Properties:
Name Type Description
total integer

Total amount of calls

success integer

Total amount of successful calls

totalErrors integer

Total errors

timeouts integer

Total amount of TimeoutError errors

rejected integer

Total amount of OpenCircuitError errors

otherErrors integer

Total amount of errors which are neither timeouts nor rejections

errors object

Total error counts by name

callRate float

Calls per second

active integer

Current active calls

queued integer

Current queued calls

Source:

Summary

Type:
  • object
Properties:
Name Type Description
times CBStats~TimesSummary

Times summary

counts CBStats~CountsSummary

Cummulative counts summary

health CBStats~HealthSummary

Health summary

Source:

TimesSummary

Type:
  • object
Properties:
Name Type Description
amean float

Arithmetic mean

median float

Median

p900 integer

90th percentile

p990 integer

99th percentile

Source: