Package io.lettuce.core.metrics
Class DefaultCommandLatencyCollectorOptions.Builder
- java.lang.Object
-
- io.lettuce.core.metrics.DefaultCommandLatencyCollectorOptions.Builder
-
- All Implemented Interfaces:
CommandLatencyCollectorOptions.Builder
- Enclosing class:
- DefaultCommandLatencyCollectorOptions
public static class DefaultCommandLatencyCollectorOptions.Builder extends Object implements CommandLatencyCollectorOptions.Builder
Builder forDefaultCommandLatencyCollectorOptions
.
-
-
Method Summary
-
-
-
Method Detail
-
disable
public DefaultCommandLatencyCollectorOptions.Builder disable()
Disable the latency collector.- Specified by:
disable
in interfaceCommandLatencyCollectorOptions.Builder
- Returns:
- this
DefaultCommandLatencyCollectorOptions.Builder
.
-
enable
public DefaultCommandLatencyCollectorOptions.Builder enable()
Enable the latency collector.- Specified by:
enable
in interfaceCommandLatencyCollectorOptions.Builder
- Returns:
- this
DefaultCommandLatencyCollectorOptions.Builder
. - Since:
- 5.1
-
usePauseDetector
public DefaultCommandLatencyCollectorOptions.Builder usePauseDetector()
UseLatencyUtils.SimplePauseDetector
to detect pauses. Defaults to no pause detector.- Specified by:
usePauseDetector
in interfaceCommandLatencyCollectorOptions.Builder
- Returns:
- this
DefaultCommandLatencyCollectorOptions.Builder
. - Since:
- 6.1.7
- See Also:
SimplePauseDetector
-
useNoPauseDetector
public DefaultCommandLatencyCollectorOptions.Builder useNoPauseDetector()
Do not detect pauses. Defaults to no pause detector.- Specified by:
useNoPauseDetector
in interfaceCommandLatencyCollectorOptions.Builder
- Returns:
- this
DefaultCommandLatencyCollectorOptions.Builder
. - Since:
- 6.1.7
-
targetUnit
public DefaultCommandLatencyCollectorOptions.Builder targetUnit(TimeUnit targetUnit)
Set the target unit for the latencies. Defaults toTimeUnit.MILLISECONDS
. SeeDefaultCommandLatencyCollectorOptions.DEFAULT_TARGET_UNIT
.- Specified by:
targetUnit
in interfaceCommandLatencyCollectorOptions.Builder
- Parameters:
targetUnit
- the target unit, must not benull
- Returns:
- this
DefaultCommandLatencyCollectorOptions.Builder
.
-
targetPercentiles
public DefaultCommandLatencyCollectorOptions.Builder targetPercentiles(double[] targetPercentiles)
Sets the emitted percentiles. Defaults to 50.0, 90.0, 95.0, 99.0, 99.9} . SeeDefaultCommandLatencyCollectorOptions.DEFAULT_TARGET_PERCENTILES
.- Specified by:
targetPercentiles
in interfaceCommandLatencyCollectorOptions.Builder
- Parameters:
targetPercentiles
- the percentiles which should be emitted, must not benull
- Returns:
- this
DefaultCommandLatencyCollectorOptions.Builder
.
-
resetLatenciesAfterEvent
public DefaultCommandLatencyCollectorOptions.Builder resetLatenciesAfterEvent(boolean resetLatenciesAfterEvent)
Sets whether the recorded latencies should be reset once the metrics event was emitted. Defaults totrue
. SeeDefaultCommandLatencyCollectorOptions.DEFAULT_RESET_LATENCIES_AFTER_EVENT
.- Specified by:
resetLatenciesAfterEvent
in interfaceCommandLatencyCollectorOptions.Builder
- Parameters:
resetLatenciesAfterEvent
-true
if the recorded latencies should be reset once the metrics event was emitted- Returns:
- this
DefaultCommandLatencyCollectorOptions.Builder
.
-
localDistinction
public DefaultCommandLatencyCollectorOptions.Builder localDistinction(boolean localDistinction)
Enables per connection metrics tracking insead of per host/port. 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. Defaults tofalse
. SeeDefaultCommandLatencyCollectorOptions.DEFAULT_LOCAL_DISTINCTION
.- Specified by:
localDistinction
in interfaceCommandLatencyCollectorOptions.Builder
- Parameters:
localDistinction
-true
if latencies are recorded distinct on local level (per connection)- Returns:
- this
DefaultCommandLatencyCollectorOptions.Builder
.
-
build
public DefaultCommandLatencyCollectorOptions build()
- Specified by:
build
in interfaceCommandLatencyCollectorOptions.Builder
- Returns:
- a new instance of
DefaultCommandLatencyCollectorOptions
.
-
-