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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractParser.ObjectInputStreamWithClassMapping
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
Fields Modifier and Type Field Description protected String
filterRegex
protected SimpleDateFormat
format
protected boolean
isNumberDateFormat
protected String
percentiles
-
Fields inherited from class hudson.plugins.performance.parsers.PerformanceReportParser
baselineBuild, excludeResponseTime, glob, reportURL, showTrendGraphs
-
-
Constructor Summary
Constructors Constructor Description AbstractParser(String glob, String percentiles, String filterRegex)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearDateFormat()
protected PerformanceReport
createPerformanceReport()
protected static PerformanceReport
loadSerializedReport(File reportFile)
Returns a PerformanceReport instance for the provided report file, based on previously serialized data.Collection<PerformanceReport>
parse(Run<?,?> build, Collection<File> reports, TaskListener listener)
Parses the specified reports intoPerformanceReport
s.Date
parseTimestamp(String timestamp)
protected static void
saveSerializedReport(File reportFile, PerformanceReport report)
Saves a PerformanceReport instance as serialized data into a file on disc.-
Methods inherited from class hudson.plugins.performance.parsers.PerformanceReportParser
all, getDefaultGlobPattern, getDescriptor, getReportName, isExcludeResponseTime, isShowTrendGraphs, setBaselineBuild, setExcludeResponseTime, setShowTrendGraphs
-
-
-
-
Field Detail
-
isNumberDateFormat
protected boolean isNumberDateFormat
-
format
protected transient SimpleDateFormat format
-
percentiles
protected String percentiles
-
filterRegex
protected String filterRegex
-
-
Method Detail
-
parse
public Collection<PerformanceReport> parse(Run<?,?> build, Collection<File> reports, TaskListener listener) throws IOException
Description copied from class:PerformanceReportParser
Parses the specified reports intoPerformanceReport
s.- Specified by:
parse
in classPerformanceReportParser
- 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()
-
createPerformanceReport
protected PerformanceReport createPerformanceReport()
-
-