Class DiagnosticsConfig
- All Implemented Interfaces:
DataSerializable
,IdentifiedDataSerializable
- Since:
- 6.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Default value of output directory.static final boolean
Default value of diagnostics whether enabled or not.static final boolean
Default value either include epoch time on diagnostics output.static final int
Default value of maximum rolled diagnostics output file count.static final int
Default value of maximum rolled diagnostics output file size in MB.static final DiagnosticsOutputType
Default value of diagnostics output type. -
Constructor Summary
ConstructorDescriptionDiagnosticsConfig
(boolean enabled) DiagnosticsConfig
(DiagnosticsConfig diagnosticsConfig) -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
Returns type identifier for this class.int
Returns DataSerializableFactory factory ID for this class.Gets the prefix for the diagnostics file.Gets the output directory of the performance log files.int
Gets the maximum number of rolling files to keep on disk.int
Gets the maximum size in MB for a single file.Gets the output for the diagnostics.Gets properties of the Diagnostic Configuration.int
hashCode()
boolean
Returns true ifDiagnostics
is enabled.boolean
Returns true if the epoch time should be included in the 'top' section.void
Reads fields from the input streamsetEnabled
(boolean enabled) Enables or disablesDiagnostics
to see internal performance metrics and cluster related information.setFileNamePrefix
(String fileNamePrefix) Configures the prefix for the diagnostics file.setIncludeEpochTime
(boolean includeEpochTime) Configures if the epoch time should be included in the 'top' section.setLogDirectory
(String logDirectory) Configures the output directory of the performance log files.setMaxRolledFileCount
(int maxRolledFileCount) Sets the maximum number of rolling files to keep on disk.setMaxRolledFileSizeInMB
(int maxRolledFileSizeInMB) Sets the maximum size in MB for a single file.setOutputType
(DiagnosticsOutputType outputType) Configures the output for the diagnostics.toString()
void
Writes object fields to output stream
-
Field Details
-
DEFAULT_MAX_ROLLED_FILE_SIZE
public static final int DEFAULT_MAX_ROLLED_FILE_SIZEDefault value of maximum rolled diagnostics output file size in MB.- See Also:
-
DEFAULT_MAX_ROLLED_FILE_COUNT
public static final int DEFAULT_MAX_ROLLED_FILE_COUNTDefault value of maximum rolled diagnostics output file count.- See Also:
-
DEFAULT_INCLUDE_EPOCH_TIME
public static final boolean DEFAULT_INCLUDE_EPOCH_TIMEDefault value either include epoch time on diagnostics output.- See Also:
-
DEFAULT_OUTPUT_TYPE
Default value of diagnostics output type. -
DEFAULT_DIRECTORY
Default value of output directory. -
DEFAULT_ENABLED
public static final boolean DEFAULT_ENABLEDDefault value of diagnostics whether enabled or not.- See Also:
-
-
Constructor Details
-
DiagnosticsConfig
public DiagnosticsConfig() -
DiagnosticsConfig
public DiagnosticsConfig(boolean enabled) -
DiagnosticsConfig
-
-
Method Details
-
isEnabled
public boolean isEnabled()Returns true ifDiagnostics
is enabled.- Returns:
- true if enabled, false otherwise
- Since:
- 6.0
-
setEnabled
Enables or disablesDiagnostics
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
.- Since:
- 6.0
-
getMaxRolledFileSizeInMB
public int getMaxRolledFileSizeInMB()Gets the maximum size in MB for a single file. The DiagnosticsLogFile uses a rolling file approach to prevent using 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.
- Since:
- 6.0
-
setMaxRolledFileSizeInMB
Sets the maximum size in MB for a single file. The DiagnosticsLogFile uses a rolling file approach to prevent using 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.
-
getMaxRolledFileCount
public int getMaxRolledFileCount()Gets the maximum number of rolling files to keep on disk. The DiagnosticsLogFile uses a rolling file approach to prevent using too much disk space.This property sets the maximum number of rolling files to keep on disk.
The default is 10.
- Since:
- 6.0
-
setMaxRolledFileCount
Sets the maximum number of rolling files to keep on disk. The DiagnosticsLogFile uses a rolling file approach to prevent using too much disk space.This property sets the maximum number of rolling files to keep on disk.
The default is 10.
- Since:
- 6.0
-
isIncludeEpochTime
public boolean isIncludeEpochTime()Returns true if the epoch time should be included in the 'top' section. -
setIncludeEpochTime
Configures if the epoch time should be included in the 'top' section. This makes it easy to determine the time in epoch format and prevents needing to parse the date-format section. The default istrue
.- Since:
- 6.0
-
getLogDirectory
Gets the output directory of the performance log files.Defaults to the value of the 'user.dir' system property.
- Since:
- 6.0
-
setLogDirectory
Configures the output directory of the performance log files.Defaults to the 'user.dir'.
- Since:
- 6.0
-
getFileNamePrefix
Gets the prefix for the diagnostics file.So instead of having e.g. 'diagnostics-...log' you get 'foobar-diagnostics-...log'.
- Since:
- 6.0
-
setFileNamePrefix
Configures the prefix for the diagnostics file.So instead of having e.g. 'diagnostics-...log' you get 'foobar-diagnostics-...log'.
- Since:
- 6.0
-
getOutputType
Gets the output for the diagnostics. The default value isDiagnosticsOutputType.FILE
which is a set of files managed by the Hazelcast process.- Since:
- 6.0
-
setOutputType
Configures the output for the diagnostics. The default value isDiagnosticsOutputType.FILE
which is a set of files managed by the Hazelcast process.- Since:
- 6.0
-
getPluginProperties
Gets properties of the Diagnostic Configuration. The properties are used by diagnostic plugins.Note that the keys and values are not verified. Make sure that the keys and values are valid and compatible with the diagnostic plugins.
- Returns:
- Plugin properties of the Diagnostic Configuration
- Since:
- 6.0
-
getFactoryId
public int getFactoryId()Description copied from interface:IdentifiedDataSerializable
Returns DataSerializableFactory factory ID for this class.- Specified by:
getFactoryId
in interfaceIdentifiedDataSerializable
- Returns:
- factory ID
-
getClassId
public int getClassId()Description copied from interface:IdentifiedDataSerializable
Returns type identifier for this class. It should be unique per DataSerializableFactory.- Specified by:
getClassId
in interfaceIdentifiedDataSerializable
- Returns:
- type ID
-
writeData
Description copied from interface:DataSerializable
Writes object fields to output stream- Specified by:
writeData
in interfaceDataSerializable
- Parameters:
out
- output- Throws:
IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the output stream has been closed.
-
readData
Description copied from interface:DataSerializable
Reads fields from the input stream- Specified by:
readData
in interfaceDataSerializable
- Parameters:
in
- input- Throws:
IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the input stream has been closed.
-
equals
-
hashCode
public int hashCode() -
toString
-