Module lettuce.core
Package io.lettuce.core.metrics
Interface CommandLatencyCollectorOptions.Builder
- All Known Implementing Classes:
DefaultCommandLatencyCollectorOptions.Builder
- Enclosing interface:
- CommandLatencyCollectorOptions
public static interface CommandLatencyCollectorOptions.Builder
Builder for
CommandLatencyCollectorOptions.- Since:
- 5.1
-
Method Summary
Modifier and Type Method Description CommandLatencyCollectorOptionsbuild()CommandLatencyCollectorOptions.Builderdisable()Disable the latency collector.CommandLatencyCollectorOptions.Builderenable()Enable the latency collector.CommandLatencyCollectorOptions.BuilderlocalDistinction(boolean localDistinction)Enables per connection metrics tracking insead of per host/port.CommandLatencyCollectorOptions.BuilderresetLatenciesAfterEvent(boolean resetLatenciesAfterEvent)Sets whether the recorded latencies should be reset once the metrics event was emitted.CommandLatencyCollectorOptions.BuildertargetPercentiles(double[] targetPercentiles)Sets the emitted percentiles.CommandLatencyCollectorOptions.BuildertargetUnit(TimeUnit targetUnit)Set the target unit for the latencies.
-
Method Details
-
disable
CommandLatencyCollectorOptions.Builder disable()Disable the latency collector.- Returns:
- this
-
enable
Enable the latency collector.- 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.- Parameters:
localDistinction-trueif latencies are recorded distinct on local level (per connection).- Returns:
- this
CommandLatencyCollectorOptions.Builder.
-
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-trueif the recorded latencies should be reset once the metrics event was emitted.- Returns:
- this
CommandLatencyCollectorOptions.Builder.
-
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
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.
-