Class DiagnosticsConfig

java.lang.Object
com.hazelcast.config.DiagnosticsConfig
All Implemented Interfaces:
DataSerializable, IdentifiedDataSerializable

public class DiagnosticsConfig extends Object implements IdentifiedDataSerializable
Configuration for diagnostics service.
Since:
6.0
  • Field Details

    • DEFAULT_MAX_ROLLED_FILE_SIZE

      public static final int DEFAULT_MAX_ROLLED_FILE_SIZE
      Default 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_COUNT
      Default value of maximum rolled diagnostics output file count.
      See Also:
    • DEFAULT_INCLUDE_EPOCH_TIME

      public static final boolean DEFAULT_INCLUDE_EPOCH_TIME
      Default value either include epoch time on diagnostics output.
      See Also:
    • DEFAULT_OUTPUT_TYPE

      public static final DiagnosticsOutputType DEFAULT_OUTPUT_TYPE
      Default value of diagnostics output type.
    • DEFAULT_DIRECTORY

      public static final String DEFAULT_DIRECTORY
      Default value of output directory.
    • DEFAULT_ENABLED

      public static final boolean DEFAULT_ENABLED
      Default value of diagnostics whether enabled or not.
      See Also:
  • Constructor Details

    • DiagnosticsConfig

      public DiagnosticsConfig()
    • DiagnosticsConfig

      public DiagnosticsConfig(boolean enabled)
    • DiagnosticsConfig

      public DiagnosticsConfig(DiagnosticsConfig diagnosticsConfig)
  • Method Details

    • isEnabled

      public boolean isEnabled()
      Returns true if Diagnostics is enabled.
      Returns:
      true if enabled, false otherwise
      Since:
      6.0
    • setEnabled

      public DiagnosticsConfig setEnabled(boolean enabled)
      Enables or disables 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.

      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

      public DiagnosticsConfig setMaxRolledFileSizeInMB(int maxRolledFileSizeInMB)
      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

      public DiagnosticsConfig setMaxRolledFileCount(int maxRolledFileCount)
      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

      public DiagnosticsConfig setIncludeEpochTime(boolean includeEpochTime)
      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 is true.
      Since:
      6.0
    • getLogDirectory

      public String getLogDirectory()
      Gets the output directory of the performance log files.

      Defaults to the value of the 'user.dir' system property.

      Since:
      6.0
    • setLogDirectory

      public DiagnosticsConfig setLogDirectory(@Nonnull String logDirectory)
      Configures the output directory of the performance log files.

      Defaults to the 'user.dir'.

      Since:
      6.0
    • getFileNamePrefix

      public String 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

      public DiagnosticsConfig setFileNamePrefix(String fileNamePrefix)
      Configures the prefix for the diagnostics file.

      So instead of having e.g. 'diagnostics-...log' you get 'foobar-diagnostics-...log'.

      Since:
      6.0
    • getOutputType

      public DiagnosticsOutputType getOutputType()
      Gets the output for the diagnostics. The default value is DiagnosticsOutputType.FILE which is a set of files managed by the Hazelcast process.
      Since:
      6.0
    • setOutputType

      public DiagnosticsConfig setOutputType(@Nonnull DiagnosticsOutputType outputType)
      Configures the output for the diagnostics. The default value is DiagnosticsOutputType.FILE which is a set of files managed by the Hazelcast process.
      Since:
      6.0
    • getPluginProperties

      public Map<String,String> 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 interface IdentifiedDataSerializable
      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 interface IdentifiedDataSerializable
      Returns:
      type ID
    • writeData

      public void writeData(ObjectDataOutput out) throws IOException
      Description copied from interface: DataSerializable
      Writes object fields to output stream
      Specified by:
      writeData in interface DataSerializable
      Parameters:
      out - output
      Throws:
      IOException - if an I/O error occurs. In particular, an IOException may be thrown if the output stream has been closed.
    • readData

      public void readData(ObjectDataInput in) throws IOException
      Description copied from interface: DataSerializable
      Reads fields from the input stream
      Specified by:
      readData in interface DataSerializable
      Parameters:
      in - input
      Throws:
      IOException - if an I/O error occurs. In particular, an IOException may be thrown if the input stream has been closed.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object