public class StoreLatencyPlugin extends DiagnosticsPlugin
DiagnosticsPlugin
that helps to detect if there are any performance issues with Stores/Loaders like e.g.
MapStore
.
This is done by instrumenting these Stores/Loaders with latency tracking probes, so that per Store/Loader all kinds of statistics like count, avg, mag, latency distribution etc is available.
One of the main purposes of this plugin is to make sure that e.g. a Database is the cause of slow performance. This
plugin is useful to be combined with SlowOperationPlugin
to get idea about where the threads are spending
their time.
If this plugin is not enabled, there is no performance hit since the Stores/Loaders don't get decorated.
Modifier and Type | Class and Description |
---|---|
static interface |
StoreLatencyPlugin.LatencyProbe |
Modifier and Type | Field and Description |
---|---|
static HazelcastProperty |
PERIOD_SECONDS
The period in seconds this plugin runs.
|
static HazelcastProperty |
RESET_PERIOD_SECONDS
The period in second the statistics should be reset.
|
logger
Constructor and Description |
---|
StoreLatencyPlugin(ILogger logger,
HazelcastProperties properties) |
StoreLatencyPlugin(NodeEngineImpl nodeEngine) |
Modifier and Type | Method and Description |
---|---|
long |
count(String serviceName,
String dataStructureName,
String methodName) |
long |
getPeriodMillis()
Returns the period of executing the monitor in millis.
|
StoreLatencyPlugin.LatencyProbe |
newProbe(String serviceName,
String dataStructureName,
String methodName) |
void |
onStart() |
void |
run(DiagnosticsLogWriter writer) |
public static final HazelcastProperty PERIOD_SECONDS
If set to 0, the plugin is disabled.
public static final HazelcastProperty RESET_PERIOD_SECONDS
Currently there is no sliding window functionality to deal with this correctly. But for the time being this setting will periodically reset the statistics.
public StoreLatencyPlugin(NodeEngineImpl nodeEngine)
public StoreLatencyPlugin(ILogger logger, HazelcastProperties properties)
public long getPeriodMillis()
DiagnosticsPlugin
If a monitor is disabled, 0 is returned.
If a monitor should run only once, a negative value is returned. This is
useful for 'static' monitors like the SystemPropertiesPlugin
that run at the beginning of a log file but their contents will not
change.
getPeriodMillis
in class DiagnosticsPlugin
public void onStart()
onStart
in class DiagnosticsPlugin
public void run(DiagnosticsLogWriter writer)
run
in class DiagnosticsPlugin
public StoreLatencyPlugin.LatencyProbe newProbe(String serviceName, String dataStructureName, String methodName)
Copyright © 2018 Hazelcast, Inc.. All Rights Reserved.