Class AbstractParser

java.lang.Object
hudson.plugins.performance.parsers.PerformanceReportParser
hudson.plugins.performance.parsers.AbstractParser
All Implemented Interfaces:
ExtensionPoint, Describable<PerformanceReportParser>
Direct Known Subclasses:
IagoParser, JMeterCsvParser, JMeterParser, JmeterSummarizerParser, JUnitParser, LoadRunnerParser, LocustParser, TaurusParser, WrkSummarizerParser

public abstract class AbstractParser extends PerformanceReportParser
An abstraction for parsing data to PerformanceReport instances. This class provides functionality that optimizes the parsing process, such as caching as well as saving/loaded parsed data in serialized form to/from disc.
Author:
Guus der Kinderen, guus.der.kinderen@gmail.com
  • Field Details

    • isNumberDateFormat

      protected boolean isNumberDateFormat
    • format

      protected transient SimpleDateFormat format
    • percentiles

      protected String percentiles
    • filterRegex

      protected String filterRegex
  • Constructor Details

    • AbstractParser

      public AbstractParser(String glob, String percentiles, String filterRegex)
  • Method Details

    • parse

      public Collection<PerformanceReport> parse(Run<?,?> build, Collection<File> reports, TaskListener listener) throws IOException
      Description copied from class: PerformanceReportParser
      Parses the specified reports into PerformanceReports.
      Specified by:
      parse in class PerformanceReportParser
      Throws:
      IOException
    • loadSerializedReport

      protected static PerformanceReport loadSerializedReport(File reportFile)
      Returns a PerformanceReport instance for the provided report file, based on previously serialized data.

      This method first attempts to load data from an internal cache. If the data is not in cache, data is obtained from a file on disc.

      When no PerformanceReport instance has previously been serialized (or when such data cannot be read, for instance because of class file changes), this method returns null.

      Parameters:
      reportFile - Report for which to return data. Cannot be null.
      Returns:
      deserialized data, possibly null.
    • saveSerializedReport

      protected static void saveSerializedReport(File reportFile, PerformanceReport report)
      Saves a PerformanceReport instance as serialized data into a file on disc.
      Parameters:
      reportFile - The file from which the original data is obtained (not the file into which serialized data is to be saved!) Cannot be null.
      report - The instance to serialize. Cannot be null.
    • clearDateFormat

      public void clearDateFormat()
    • parseTimestamp

      public Date parseTimestamp(String timestamp)
    • createPerformanceReport

      protected PerformanceReport createPerformanceReport()