Module lettuce.core
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 for
DefaultCommandLatencyCollectorOptions.-
Method Summary
Modifier and Type Method Description DefaultCommandLatencyCollectorOptionsbuild()DefaultCommandLatencyCollectorOptions.Builderdisable()Disable the latency collector.DefaultCommandLatencyCollectorOptions.Builderenable()Enable the latency collector.DefaultCommandLatencyCollectorOptions.BuilderlocalDistinction(boolean localDistinction)Enables per connection metrics tracking insead of per host/port.DefaultCommandLatencyCollectorOptions.BuilderresetLatenciesAfterEvent(boolean resetLatenciesAfterEvent)Sets whether the recorded latencies should be reset once the metrics event was emitted.DefaultCommandLatencyCollectorOptions.BuildertargetPercentiles(double[] targetPercentiles)Sets the emitted percentiles.DefaultCommandLatencyCollectorOptions.BuildertargetUnit(TimeUnit targetUnit)Set the target unit for the latencies.
-
Method Details
-
disable
Disable the latency collector.- Specified by:
disablein interfaceCommandLatencyCollectorOptions.Builder- Returns:
- this
DefaultCommandLatencyCollectorOptions.Builder.
-
enable
Enable the latency collector.- Specified by:
enablein interfaceCommandLatencyCollectorOptions.Builder- Returns:
- this
DefaultCommandLatencyCollectorOptions.Builder. - Since:
- 5.1
-
targetUnit
Set the target unit for the latencies. Defaults toTimeUnit.MILLISECONDS. SeeDefaultCommandLatencyCollectorOptions.DEFAULT_TARGET_UNIT.- Specified by:
targetUnitin interfaceCommandLatencyCollectorOptions.Builder- Parameters:
targetUnit- the target unit, must not benull- Returns:
- this
DefaultCommandLatencyCollectorOptions.Builder.
-
targetPercentiles
Sets the emitted percentiles. Defaults to 50.0, 90.0, 95.0, 99.0, 99.9} . SeeDefaultCommandLatencyCollectorOptions.DEFAULT_TARGET_PERCENTILES.- Specified by:
targetPercentilesin 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:
resetLatenciesAfterEventin interfaceCommandLatencyCollectorOptions.Builder- Parameters:
resetLatenciesAfterEvent-trueif the recorded latencies should be reset once the metrics event was emitted- Returns:
- this
DefaultCommandLatencyCollectorOptions.Builder.
-
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:
localDistinctionin interfaceCommandLatencyCollectorOptions.Builder- Parameters:
localDistinction-trueif latencies are recorded distinct on local level (per connection)- Returns:
- this
DefaultCommandLatencyCollectorOptions.Builder.
-
build
- Specified by:
buildin interfaceCommandLatencyCollectorOptions.Builder- Returns:
- a new instance of
DefaultCommandLatencyCollectorOptions.
-