Class LogFileCalculator

java.lang.Object
outputProviders.logInputter.LogFileCalculator

public class LogFileCalculator extends Object
This class contains methods to calculate the statistics of the iteration results of this fuzz attempt, such as exit code counts, unique values, execution time, ... . It also holds the full name of each variable.
  • Constructor Details

    • LogFileCalculator

      public LogFileCalculator()
  • Method Details

    • getExitCodeCount

      public static int getExitCodeCount(List<IterationResult> results, int exitCode)
      Retrieves the count of iteration results with a specific exit code from a list of iteration results.
      Parameters:
      results - The list of iteration results.
      exitCode - The exit code to count.
      Returns:
      The count of iteration results with the specified exit code.
    • getCurrentTimestamp

      public static String getCurrentTimestamp()
      Retrieves the current timestamp in the format "dd-MM-yyyy HH:mm".
      Returns:
      The current timestamp as a formatted string.
    • getExecutionTime

      public static String getExecutionTime(long elapsedTime)
      Retrieves the execution time in milliseconds as a formatted string in the format "mm:ss".
      Parameters:
      elapsedTime - The elapsed time in milliseconds.
      Returns:
      The execution time as a formatted string.
    • getUniqueValues

      public static List<String> getUniqueValues(ArrayList<IterationResult> results, String variableName)
      Gets the unique values for a specific variable name from a list of iteration results.
      Parameters:
      results - List of iteration results where u need the unique value from.
      variableName - Variable name as specified in the getFullVariableName method input.
      Returns:
      List of strings that are the unique values. For error code -> Parsed into String.
    • getFullVariableName

      public static String getFullVariableName(String variableName, boolean appendColon)
      Get the full variable names of each short name.
      Parameters:
      variableName - Short name of variable.
      appendColon - True if you want to append a colon and a space to the end of the variable name.
      Returns:
      String, full name of the variable in natural language.