Package io.lettuce.core.metrics
Class DefaultCommandLatencyCollectorOptions
- java.lang.Object
-
- io.lettuce.core.metrics.DefaultCommandLatencyCollectorOptions
-
- All Implemented Interfaces:
CommandLatencyCollectorOptions
public class DefaultCommandLatencyCollectorOptions extends Object implements CommandLatencyCollectorOptions
The default implementation ofCommandLatencyCollectorOptions
.- Author:
- Mark Paluch
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DefaultCommandLatencyCollectorOptions.Builder
Builder forDefaultCommandLatencyCollectorOptions
.
-
Field Summary
Fields Modifier and Type Field Description static boolean
DEFAULT_ENABLED
static boolean
DEFAULT_LOCAL_DISTINCTION
static boolean
DEFAULT_RESET_LATENCIES_AFTER_EVENT
static double[]
DEFAULT_TARGET_PERCENTILES
static TimeUnit
DEFAULT_TARGET_UNIT
static boolean
DEFAULT_USE_NO_PAUSE_DETECTOR
-
Constructor Summary
Constructors Modifier Constructor Description protected
DefaultCommandLatencyCollectorOptions(DefaultCommandLatencyCollectorOptions.Builder builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DefaultCommandLatencyCollectorOptions.Builder
builder()
Returns a newDefaultCommandLatencyCollectorOptions.Builder
to constructDefaultCommandLatencyCollectorOptions
.static DefaultCommandLatencyCollectorOptions
create()
Create a newDefaultCommandLatencyCollectorOptions
instance using default settings.static DefaultCommandLatencyCollectorOptions
disabled()
Create aDefaultCommandLatencyCollectorOptions
instance with disabled event emission.boolean
isEnabled()
Returns whether the latency collector is enabled.boolean
localDistinction()
Returns whether to distinct latencies on local level.DefaultCommandLatencyCollectorOptions.Builder
mutate()
Returns a builder to create newDefaultCommandLatencyCollectorOptions
whose settings are replicated from the currentDefaultCommandLatencyCollectorOptions
.boolean
resetLatenciesAfterEvent()
Returns whether the latencies should be reset once an event is emitted.double[]
targetPercentiles()
Returns the percentiles which should be exposed in the metric.TimeUnit
targetUnit()
Returns the targetTimeUnit
for the emitted latencies.boolean
usePauseDetector()
Returns whether PauseDetector is enabled.
-
-
-
Field Detail
-
DEFAULT_TARGET_UNIT
public static final TimeUnit 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
-
DEFAULT_USE_NO_PAUSE_DETECTOR
public static final boolean DEFAULT_USE_NO_PAUSE_DETECTOR
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DefaultCommandLatencyCollectorOptions
protected DefaultCommandLatencyCollectorOptions(DefaultCommandLatencyCollectorOptions.Builder builder)
-
-
Method Detail
-
create
public static DefaultCommandLatencyCollectorOptions create()
Create a newDefaultCommandLatencyCollectorOptions
instance using default settings.- Returns:
- a new instance of
DefaultCommandLatencyCollectorOptions
instance using default settings
-
disabled
public static DefaultCommandLatencyCollectorOptions disabled()
Create aDefaultCommandLatencyCollectorOptions
instance with disabled event emission.- Returns:
- a new instance of
DefaultCommandLatencyCollectorOptions
with disabled event emission
-
builder
public static DefaultCommandLatencyCollectorOptions.Builder builder()
Returns a newDefaultCommandLatencyCollectorOptions.Builder
to constructDefaultCommandLatencyCollectorOptions
.- Returns:
- a new
DefaultCommandLatencyCollectorOptions.Builder
to constructDefaultCommandLatencyCollectorOptions
.
-
mutate
public DefaultCommandLatencyCollectorOptions.Builder mutate()
Returns a builder to create newDefaultCommandLatencyCollectorOptions
whose settings are replicated from the currentDefaultCommandLatencyCollectorOptions
.- Specified by:
mutate
in interfaceCommandLatencyCollectorOptions
- Returns:
- a a
CommandLatencyCollectorOptions.Builder
to create newDefaultCommandLatencyCollectorOptions
whose settings are replicated from the currentDefaultCommandLatencyCollectorOptions
- Since:
- 5.1
-
targetUnit
public TimeUnit targetUnit()
Description copied from interface:CommandLatencyCollectorOptions
Returns the targetTimeUnit
for the emitted latencies.- Specified by:
targetUnit
in interfaceCommandLatencyCollectorOptions
- Returns:
- the target
TimeUnit
for the emitted latencies
-
targetPercentiles
public double[] targetPercentiles()
Description copied from interface:CommandLatencyCollectorOptions
Returns the percentiles which should be exposed in the metric.- Specified by:
targetPercentiles
in interfaceCommandLatencyCollectorOptions
- Returns:
- the percentiles which should be exposed in the metric
-
resetLatenciesAfterEvent
public boolean resetLatenciesAfterEvent()
Description copied from interface:CommandLatencyCollectorOptions
Returns whether the latencies should be reset once an event is emitted.- Specified by:
resetLatenciesAfterEvent
in interfaceCommandLatencyCollectorOptions
- Returns:
true
if the latencies should be reset once an event is emitted.
-
localDistinction
public boolean localDistinction()
Description copied from interface:CommandLatencyCollectorOptions
Returns 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:
localDistinction
in interfaceCommandLatencyCollectorOptions
- Returns:
true
if latencies are recorded distinct on local level (per connection)
-
isEnabled
public boolean isEnabled()
Description copied from interface:CommandLatencyCollectorOptions
Returns whether the latency collector is enabled.- Specified by:
isEnabled
in interfaceCommandLatencyCollectorOptions
- Returns:
true
if the latency collector is enabled
-
usePauseDetector
public boolean usePauseDetector()
Description copied from interface:CommandLatencyCollectorOptions
Returns whether PauseDetector is enabled. Defaults to no pause detector.- Specified by:
usePauseDetector
in interfaceCommandLatencyCollectorOptions
- Returns:
true
if the PauseDetector is enabled
-
-