Class ThreadDumpSaver


  • public class ThreadDumpSaver
    extends Object
    Created by Andrey Titov on 12.01.16.
    • Constructor Detail

      • ThreadDumpSaver

        protected ThreadDumpSaver()
    • Method Detail

      • getInstance

        @NotNull
        public static ThreadDumpSaver getInstance()
        To be used only from static context, consider using bean instead
      • doSaveDump

        @Nullable
        public File doSaveDump​(@NotNull
                               String fileSuffix,
                               @NotNull
                               String summary)
      • doSaveDump

        @Nullable
        public File doSaveDump​(@NotNull
                               String fileSuffix,
                               @NotNull
                               String fileHeader,
                               @NotNull
                               String logDescription)
      • doSaveDump

        @Nullable
        public File doSaveDump​(@NotNull
                               String fileSuffix,
                               @NotNull
                               String fileHeader,
                               @NotNull
                               String additionalInfo,
                               @NotNull
                               String logDescription)
        Try save dump to a file. File location and base name is retrieved from current ThreadDumpSaverContext. If the file couldn't be saved an error message will be shown in the log. The format of the thread dump file: <fileHeader> <Server info including version, licensing, java options and some database info> <additionalInfo> <All threads currently alive> <Memory and CPU usage>
        Parameters:
        fileSuffix - A source ID for this thread dump, eg: 'periodical', 'manual', 'longRequest', ... Is added to the end of the filename. Default value is 'threadDump' if empty.
        fileHeader - Short description for the thread dump to be shown in the very beginning of the file - before server info. Should be short and informative. Won't be added if empty.
        additionalInfo - Any additional info to be added between the server info block and the thread dump
        logDescription - Thread dump description to be shown in the log in case of error
        Returns:
        File if it was created or null otherwise