Class ProfileAnalyzer


  • public class ProfileAnalyzer
    extends Object
    • Constructor Detail

      • ProfileAnalyzer

        public ProfileAnalyzer()
    • Method Detail

      • summarizeProfile

        public static void summarizeProfile​(File file,
                                            ProfileAnalyzer.ProfileFormat profileFormat)
        Summarize and print to stdout the specified profile file
        Parameters:
        file - Profile file
        profileFormat - Format of the profiler file
      • summarizeProfileStr

        public static String summarizeProfileStr​(File file,
                                                 ProfileAnalyzer.ProfileFormat profileFormat)
        Summarize and return as a string the specified profile file
        Parameters:
        file - Profile file
        profileFormat - Format of the profiler file
      • summarizeProfileDirectory

        public static void summarizeProfileDirectory​(File dir,
                                                     ProfileAnalyzer.ProfileFormat profileFormat)
        Aggregate, summarize and print to stdout all .json profile files in the specified directory (not recursive)
        Parameters:
        dir - Directory containing the profiles
        profileFormat - Profile format
      • summarizeProfileDirectoryStr

        public static String summarizeProfileDirectoryStr​(File dir,
                                                          ProfileAnalyzer.ProfileFormat profileFormat)
        Aggregate, summarize and return as a String all .json profile files in the specified directory (not recursive)
        Parameters:
        dir - Directory containing the profiles
        profileFormat - Profile format
      • getTraceEventsDir

        public static TraceEvent[] getTraceEventsDir​(File dir,
                                                     ProfileAnalyzer.ProfileFormat profileFormat)
        Load, aggregate and return the TraceEvent object from all profiles in the specified directory
        Parameters:
        dir - Directory containing the profiles
        profileFormat - Profile format
      • getTraceEvents

        public static TraceEvent[] getTraceEvents​(File file,
                                                  ProfileAnalyzer.ProfileFormat profileFormat)
        Load and return the TraceEvent object from the specified profile file
        Parameters:
        file - Profile file
        profileFormat - Profile format
      • summarizeTraceEvents

        public static String summarizeTraceEvents​(TraceEvent[] events)
        Summarize the specified TraceEvents as a String
        Parameters:
        events - Events to summarize
      • compareProfiles

        public static String compareProfiles​(@NonNull
                                             @NonNull File file1,
                                             @NonNull
                                             @NonNull File file2,
                                             @NonNull
                                             @NonNull ProfileAnalyzer.ProfileFormat format1,
                                             @NonNull
                                             @NonNull ProfileAnalyzer.ProfileFormat format2)
        Compare the specified profile files, sorted by profile 1 % of total time
        Parameters:
        file1 - First profile file
        file2 - Second profile file
        format1 - Format of first profile
        format2 - Format of second profile
        Returns:
        Comparison summary as a String
      • compareProfiles

        public static String compareProfiles​(@NonNull
                                             @NonNull File file1,
                                             @NonNull
                                             @NonNull File file2,
                                             @NonNull
                                             @NonNull ProfileAnalyzer.ProfileFormat format1,
                                             @NonNull
                                             @NonNull ProfileAnalyzer.ProfileFormat format2,
                                             boolean firstIsDir,
                                             boolean secondIsDir,
                                             String name1,
                                             String name2,
                                             ProfileAnalyzer.SortBy sortBy)
        Compare the specified profile files or directory
        Parameters:
        file1 - First profile file or directory of profiles
        file2 - Second profile file or directory of profiles
        format1 - Format for first profile file/s
        format2 - Format for second profile file/s
        firstIsDir - True if the first File object is a directory
        secondIsDir - True if the second File object is a directory
        name1 - Name of the first profile (just for display purposes). Optional
        name2 - Name of the second profile (just for display purposes). Optional
        sortBy - What to sort the summary results by
        Returns:
        Comparison summary as a String
      • compareProfiles

        public static String compareProfiles​(Config c)