public class Diagnostics extends Object
Diagnostics
is a debugging tool that provides insight in all kinds
of potential performance and stability issues. The actual logic to provide such
insights, is placed in the DiagnosticsPlugin
.Modifier and Type | Field and Description |
---|---|
static HazelcastProperty |
DIRECTORY
Configures the output directory of the performance log files.
|
static HazelcastProperty |
ENABLED
Use the
Diagnostics to see internal performance metrics and cluster
related information. |
static HazelcastProperty |
FILENAME_PREFIX
Configures the prefix for the diagnostics file.
|
static HazelcastProperty |
INCLUDE_EPOCH_TIME
Configures if the epoch time should be included in the 'top' section.
|
static HazelcastProperty |
MAX_ROLLED_FILE_COUNT
The
DiagnosticsLogFile uses a rolling file approach to prevent
eating too much disk space. |
static HazelcastProperty |
MAX_ROLLED_FILE_SIZE_MB
The
DiagnosticsLogFile uses a rolling file approach to prevent
eating too much disk space. |
static HazelcastProperty |
METRICS_DISTRIBUTED_DATASTRUCTURES
If metrics should be tracked on distributed data structures like IMap,
IQueue etc.
|
static HazelcastProperty |
METRICS_LEVEL
The minimum level for probes is MANDATORY, but it can be changed to INFO
or DEBUG.
|
static String |
PREFIX |
Constructor and Description |
---|
Diagnostics(String baseFileName,
ILogger logger,
String hzName,
HazelcastProperties properties) |
Modifier and Type | Method and Description |
---|---|
File |
currentFile() |
<P extends DiagnosticsPlugin> |
getPlugin(Class<P> pluginClass)
Gets the plugin for a given plugin class.
|
void |
register(DiagnosticsPlugin plugin)
Registers a
DiagnosticsPlugin . |
void |
shutdown() |
void |
start() |
public static final String PREFIX
public static final HazelcastProperty METRICS_LEVEL
By default only mandatory probes are being tracked
public static final HazelcastProperty METRICS_DISTRIBUTED_DATASTRUCTURES
By default, these data structures are not tracked, but in a future release
this will probably be changed to true
.
public static final HazelcastProperty ENABLED
Diagnostics
to see internal performance metrics and cluster
related information.
The performance monitor logs all metrics into the log file.
For more detailed information, please check the METRICS_LEVEL.
The default is false
.
public static final HazelcastProperty MAX_ROLLED_FILE_SIZE_MB
DiagnosticsLogFile
uses a rolling file approach to prevent
eating too much disk space.
This property sets the maximum size in MB for a single file.
Every HazelcastInstance will get its own history of log files.
The default is 50.
public static final HazelcastProperty MAX_ROLLED_FILE_COUNT
DiagnosticsLogFile
uses a rolling file approach to prevent
eating too much disk space.
This property sets the maximum number of rolling files to keep on disk.
The default is 10.
public static final HazelcastProperty INCLUDE_EPOCH_TIME
false
since it will cause more noise.public static final HazelcastProperty DIRECTORY
Defaults to the 'user.dir'.
public static final HazelcastProperty FILENAME_PREFIX
So instead of having e.g. 'diagnostics-...log' you get 'foobar-diagnostics-...log'.
public Diagnostics(String baseFileName, ILogger logger, String hzName, HazelcastProperties properties)
public File currentFile()
public <P extends DiagnosticsPlugin> P getPlugin(Class<P> pluginClass)
P
- type of the pluginpluginClass
- the class of the DiagnosticsPluginnull
if not activepublic void register(DiagnosticsPlugin plugin)
DiagnosticsPlugin
.
This method is thread-safe.
There is no checking for duplicate registration.
If the Diagnostics
is disabled, the call is ignored.
plugin
- the plugin to registerNullPointerException
- if plugin is null
public void start()
public void shutdown()
Copyright © 2020 Hazelcast, Inc.. All Rights Reserved.