Package io.lettuce.core.metrics
Interface CommandLatencyCollectorOptions.Builder
-
- All Known Implementing Classes:
DefaultCommandLatencyCollectorOptions.Builder
- Enclosing interface:
- CommandLatencyCollectorOptions
public static interface CommandLatencyCollectorOptions.Builder
Builder forCommandLatencyCollectorOptions
.- Since:
- 5.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CommandLatencyCollectorOptions
build()
CommandLatencyCollectorOptions.Builder
disable()
Disable the latency collector.CommandLatencyCollectorOptions.Builder
enable()
Enable the latency collector.CommandLatencyCollectorOptions.Builder
localDistinction(boolean localDistinction)
Enables per connection metrics tracking instead of per host/port.CommandLatencyCollectorOptions.Builder
resetLatenciesAfterEvent(boolean resetLatenciesAfterEvent)
Sets whether the recorded latencies should be reset once the metrics event was emitted.CommandLatencyCollectorOptions.Builder
targetPercentiles(double[] targetPercentiles)
Sets the emitted percentiles.CommandLatencyCollectorOptions.Builder
targetUnit(TimeUnit targetUnit)
Set the target unit for the latencies.CommandLatencyCollectorOptions.Builder
useNoPauseDetector()
Do not detect pauses.CommandLatencyCollectorOptions.Builder
usePauseDetector()
UseLatencyUtils.SimplePauseDetector
to detect pauses.
-
-
-
Method Detail
-
disable
CommandLatencyCollectorOptions.Builder disable()
Disable the latency collector.- Returns:
- this
-
enable
CommandLatencyCollectorOptions.Builder enable()
Enable the latency collector.- Returns:
- this
DefaultCommandLatencyCollectorOptions.Builder
.
-
usePauseDetector
CommandLatencyCollectorOptions.Builder usePauseDetector()
UseLatencyUtils.SimplePauseDetector
to detect pauses. Defaults to no pause detector.- Returns:
- this
DefaultCommandLatencyCollectorOptions.Builder
. - Since:
- 6.1.7
- See Also:
SimplePauseDetector
-
useNoPauseDetector
CommandLatencyCollectorOptions.Builder useNoPauseDetector()
Do not detect pauses. Defaults to no pause detector.- Returns:
- this
DefaultCommandLatencyCollectorOptions.Builder
. - Since:
- 6.1.7
-
localDistinction
CommandLatencyCollectorOptions.Builder localDistinction(boolean localDistinction)
Enables per connection metrics tracking instead 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
.- Parameters:
localDistinction
-true
if latencies are recorded distinct on local level (per connection).- Returns:
- this
CommandLatencyCollectorOptions.Builder
.
-
resetLatenciesAfterEvent
CommandLatencyCollectorOptions.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
.- Parameters:
resetLatenciesAfterEvent
-true
if the recorded latencies should be reset once the metrics event was emitted.- Returns:
- this
CommandLatencyCollectorOptions.Builder
.
-
targetPercentiles
CommandLatencyCollectorOptions.Builder targetPercentiles(double[] targetPercentiles)
Sets the emitted percentiles. Defaults to 50.0, 90.0, 95.0, 99.0, 99.9}. SeeDefaultCommandLatencyCollectorOptions.DEFAULT_TARGET_PERCENTILES
.- Parameters:
targetPercentiles
- the percentiles which should be emitted, must not benull
.- Returns:
- this
CommandLatencyCollectorOptions.Builder
.
-
targetUnit
CommandLatencyCollectorOptions.Builder targetUnit(TimeUnit targetUnit)
Set the target unit for the latencies. Defaults toTimeUnit.MILLISECONDS
. SeeDefaultCommandLatencyCollectorOptions.DEFAULT_TARGET_UNIT
.- Parameters:
targetUnit
- the target unit, must not benull
.- Returns:
- this
CommandLatencyCollectorOptions.Builder
.
-
build
CommandLatencyCollectorOptions build()
- Returns:
- a new instance of
CommandLatencyCollectorOptions
.
-
-