java.lang.Object
io.lettuce.core.metrics.DefaultCommandLatencyCollectorOptions
- All Implemented Interfaces:
CommandLatencyCollectorOptions
public class DefaultCommandLatencyCollectorOptions extends Object implements CommandLatencyCollectorOptions
The default implementation of
CommandLatencyCollectorOptions.- Author:
- Mark Paluch
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDefaultCommandLatencyCollectorOptions.BuilderBuilder forDefaultCommandLatencyCollectorOptions. -
Field Summary
Fields Modifier and Type Field Description static booleanDEFAULT_ENABLEDstatic booleanDEFAULT_LOCAL_DISTINCTIONstatic booleanDEFAULT_RESET_LATENCIES_AFTER_EVENTstatic double[]DEFAULT_TARGET_PERCENTILESstatic TimeUnitDEFAULT_TARGET_UNIT -
Constructor Summary
Constructors Modifier Constructor Description protectedDefaultCommandLatencyCollectorOptions(DefaultCommandLatencyCollectorOptions.Builder builder) -
Method Summary
Modifier and Type Method Description static DefaultCommandLatencyCollectorOptions.Builderbuilder()Returns a newDefaultCommandLatencyCollectorOptions.Builderto constructDefaultCommandLatencyCollectorOptions.static DefaultCommandLatencyCollectorOptionscreate()Create a newDefaultCommandLatencyCollectorOptionsinstance using default settings.static DefaultCommandLatencyCollectorOptionsdisabled()Create aDefaultCommandLatencyCollectorOptionsinstance with disabled event emission.booleanisEnabled()Returns whether the latency collector is enabled.booleanlocalDistinction()Returns whether to distinct latencies on local level.DefaultCommandLatencyCollectorOptions.Buildermutate()Returns a builder to create newDefaultCommandLatencyCollectorOptionswhose settings are replicated from the currentDefaultCommandLatencyCollectorOptions.booleanresetLatenciesAfterEvent()Returns whether the latencies should be reset once an event is emitted.double[]targetPercentiles()Returns the percentiles which should be exposed in the metric.TimeUnittargetUnit()Returns the targetTimeUnitfor the emitted latencies.
-
Field Details
-
DEFAULT_TARGET_UNIT
-
DEFAULT_TARGET_PERCENTILES
public static final double[] DEFAULT_TARGET_PERCENTILES -
DEFAULT_RESET_LATENCIES_AFTER_EVENT
public static final boolean DEFAULT_RESET_LATENCIES_AFTER_EVENT- See Also:
- Constant Field Values
-
DEFAULT_LOCAL_DISTINCTION
public static final boolean DEFAULT_LOCAL_DISTINCTION- See Also:
- Constant Field Values
-
DEFAULT_ENABLED
public static final boolean DEFAULT_ENABLED- See Also:
- Constant Field Values
-
-
Constructor Details
-
DefaultCommandLatencyCollectorOptions
protected DefaultCommandLatencyCollectorOptions(DefaultCommandLatencyCollectorOptions.Builder builder)
-
-
Method Details
-
create
Create a newDefaultCommandLatencyCollectorOptionsinstance using default settings.- Returns:
- a new instance of
DefaultCommandLatencyCollectorOptionsinstance using default settings
-
disabled
Create aDefaultCommandLatencyCollectorOptionsinstance with disabled event emission.- Returns:
- a new instance of
DefaultCommandLatencyCollectorOptionswith disabled event emission
-
builder
Returns a newDefaultCommandLatencyCollectorOptions.Builderto constructDefaultCommandLatencyCollectorOptions.- Returns:
- a new
DefaultCommandLatencyCollectorOptions.Builderto constructDefaultCommandLatencyCollectorOptions.
-
mutate
Returns a builder to create newDefaultCommandLatencyCollectorOptionswhose settings are replicated from the currentDefaultCommandLatencyCollectorOptions.- Specified by:
mutatein interfaceCommandLatencyCollectorOptions- Returns:
- a a
CommandLatencyCollectorOptions.Builderto create newDefaultCommandLatencyCollectorOptionswhose settings are replicated from the currentDefaultCommandLatencyCollectorOptions - Since:
- 5.1
-
targetUnit
Description copied from interface:CommandLatencyCollectorOptionsReturns the targetTimeUnitfor the emitted latencies.- Specified by:
targetUnitin interfaceCommandLatencyCollectorOptions- Returns:
- the target
TimeUnitfor the emitted latencies
-
targetPercentiles
public double[] targetPercentiles()Description copied from interface:CommandLatencyCollectorOptionsReturns the percentiles which should be exposed in the metric.- Specified by:
targetPercentilesin interfaceCommandLatencyCollectorOptions- Returns:
- the percentiles which should be exposed in the metric
-
resetLatenciesAfterEvent
public boolean resetLatenciesAfterEvent()Description copied from interface:CommandLatencyCollectorOptionsReturns whether the latencies should be reset once an event is emitted.- Specified by:
resetLatenciesAfterEventin interfaceCommandLatencyCollectorOptions- Returns:
trueif the latencies should be reset once an event is emitted.
-
localDistinction
public boolean localDistinction()Description copied from interface:CommandLatencyCollectorOptionsReturns whether to distinct latencies on local level. Iftrue, multiple connections to the same host/connection point will be recorded separately which allows to inspect every connection individually. Iffalse, multiple connections to the same host/connection point will be recorded together. This allows a consolidated view on one particular service.- Specified by:
localDistinctionin interfaceCommandLatencyCollectorOptions- Returns:
trueif latencies are recorded distinct on local level (per connection)
-
isEnabled
public boolean isEnabled()Description copied from interface:CommandLatencyCollectorOptionsReturns whether the latency collector is enabled.- Specified by:
isEnabledin interfaceCommandLatencyCollectorOptions- Returns:
trueif the latency collector is enabled
-