Package org.ow2.clif.jenkins.parser.clif
Class ClifParser
- java.lang.Object
-
- org.ow2.clif.jenkins.parser.clif.ClifParser
-
public class ClifParser extends Object
Class that parses ClifBuilder result directory to compute statistics.
Only the latest test execution is scanned to retrieve probe and injector data.- Author:
- Julien Coste, Bruno Dillenseger
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,Pattern>
actionAliasPatterns
protected Map<String,ActionStatInfo>
aggregatedStatsByAction
protected String
clifReportDirectory
protected ParsingContext
context
protected org.ow2.clif.storage.lib.util.DateEventFilter
dateEventFilter
protected List<String>
eventTypeToExclude
protected PrintStream
logger
protected File
ouputDirectory
protected Pattern
patternProbeName
protected ClifReport
report
protected Map<String,ActionStatInfo>
statsByAction
protected org.ow2.clif.storage.api.StorageRead
storageRead
protected Map<String,Pattern>
successfulResultPatterns
-
Constructor Summary
Constructors Constructor Description ClifParser(String clifReportDirectory, File ouputDirectory)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addActionAliasPattern(String actionAlias, String pattern)
void
addDateFilter(long from, long to)
protected void
addError(String action)
protected void
addEventToAggregatedStat(String action, long date, int duration)
protected void
addEventToStat(String action, org.ow2.clif.storage.api.BladeEvent actionEvent)
void
addSuccessfulResultPattern(String actionType, String pattern)
protected void
analyseBlade(TestPlan testPlan, org.ow2.clif.storage.api.BladeDescriptor bladeDescriptor)
protected void
analyzeEventType(Injector injector)
protected void
analyzeEventType(Probe probe)
protected void
analyzeInjector(TestPlan testPlan)
protected void
analyzeProbe(TestPlan testPlan)
protected void
analyzeTestPlan(org.ow2.clif.storage.api.BladeFilter bladeFilter)
protected String
buildAction(org.ow2.clif.storage.api.BladeEvent actionEvent)
protected Injector
createInjector(org.ow2.clif.storage.api.BladeDescriptor bladeDesc)
protected Measure
createInjectorMeasure(String name, ActionStatInfo statInfo)
protected Probe
createProbe(org.ow2.clif.storage.api.BladeDescriptor bladeDesc)
protected Measure
createProbeMeasure(String name, ActionStatInfo statInfo)
void
enableDataCleanup(double keepFactor, double keepPercentage)
Enable the data cleanup functionalityprotected String
extractProbeSimpleName(String probeClassName)
protected static String
extractTestPlanName(String clifTestPlanName)
protected String
getAlias(String action)
protected boolean
isEventInError(org.ow2.clif.storage.api.BladeEvent actionEvent)
protected boolean
isSuccessfulResult(org.ow2.clif.storage.api.BladeEvent actionEvent)
protected static int
lastOrdinalIndexOf(String str, String searchStr, int ordinal)
ClifReport
parse(PrintStream logger)
Parses the specified report directory to generate aClifReport
for the latest test execution.void
setChartConfiguration(ChartConfiguration chartConfiguration)
void
setGenerateCharts(boolean generateCharts)
protected static double
toDouble(Object value)
Convert an object to a double value.
AnyNumber
is directly converted.
-
-
-
Field Detail
-
clifReportDirectory
protected final String clifReportDirectory
-
ouputDirectory
protected final File ouputDirectory
-
dateEventFilter
protected org.ow2.clif.storage.lib.util.DateEventFilter dateEventFilter
-
context
protected final ParsingContext context
-
report
protected ClifReport report
-
statsByAction
protected Map<String,ActionStatInfo> statsByAction
-
aggregatedStatsByAction
protected Map<String,ActionStatInfo> aggregatedStatsByAction
-
storageRead
protected org.ow2.clif.storage.api.StorageRead storageRead
-
logger
protected PrintStream logger
-
patternProbeName
protected final Pattern patternProbeName
-
-
Method Detail
-
addDateFilter
public void addDateFilter(long from, long to)
-
addSuccessfulResultPattern
public void addSuccessfulResultPattern(String actionType, String pattern)
-
enableDataCleanup
public void enableDataCleanup(double keepFactor, double keepPercentage)
Enable the data cleanup functionality- Parameters:
keepFactor
- number of standard deviation to keep around the mean valuekeepPercentage
- percentage of value to keep
-
parse
public ClifReport parse(PrintStream logger) throws ClifParserException
Parses the specified report directory to generate aClifReport
for the latest test execution.- Parameters:
logger
- logger to use- Returns:
- the ClifReport object build during the parsing
- Throws:
ClifParserException
- if any problem occurs
-
analyzeTestPlan
protected void analyzeTestPlan(org.ow2.clif.storage.api.BladeFilter bladeFilter) throws org.ow2.clif.supervisor.api.ClifException
- Throws:
org.ow2.clif.supervisor.api.ClifException
-
analyseBlade
protected void analyseBlade(TestPlan testPlan, org.ow2.clif.storage.api.BladeDescriptor bladeDescriptor) throws org.ow2.clif.supervisor.api.ClifException
- Throws:
org.ow2.clif.supervisor.api.ClifException
-
lastOrdinalIndexOf
protected static int lastOrdinalIndexOf(String str, String searchStr, int ordinal)
-
analyzeProbe
protected void analyzeProbe(TestPlan testPlan) throws org.ow2.clif.supervisor.api.ClifException
- Throws:
org.ow2.clif.supervisor.api.ClifException
-
createProbe
protected Probe createProbe(org.ow2.clif.storage.api.BladeDescriptor bladeDesc)
-
analyzeInjector
protected void analyzeInjector(TestPlan testPlan) throws org.ow2.clif.supervisor.api.ClifException
- Throws:
org.ow2.clif.supervisor.api.ClifException
-
createInjector
protected Injector createInjector(org.ow2.clif.storage.api.BladeDescriptor bladeDesc)
-
analyzeEventType
protected void analyzeEventType(Probe probe) throws org.ow2.clif.supervisor.api.ClifException
- Throws:
org.ow2.clif.supervisor.api.ClifException
-
analyzeEventType
protected void analyzeEventType(Injector injector) throws org.ow2.clif.supervisor.api.ClifException
- Throws:
org.ow2.clif.supervisor.api.ClifException
-
addError
protected void addError(String action)
-
addEventToStat
protected void addEventToStat(String action, org.ow2.clif.storage.api.BladeEvent actionEvent)
-
addEventToAggregatedStat
protected void addEventToAggregatedStat(String action, long date, int duration)
-
isEventInError
protected boolean isEventInError(org.ow2.clif.storage.api.BladeEvent actionEvent)
-
isSuccessfulResult
protected boolean isSuccessfulResult(org.ow2.clif.storage.api.BladeEvent actionEvent)
-
buildAction
protected String buildAction(org.ow2.clif.storage.api.BladeEvent actionEvent)
-
createProbeMeasure
protected Measure createProbeMeasure(String name, ActionStatInfo statInfo)
-
createInjectorMeasure
protected Measure createInjectorMeasure(String name, ActionStatInfo statInfo)
-
toDouble
protected static double toDouble(Object value)
Convert an object to a double value.
AnyNumber
is directly converted.Boolean
are also converted: Boolean.TRUE = 1 and Boolean.FALSE = 0. For other objects, the return value is 1- Parameters:
value
- Obejct to convert- Returns:
- double value associeted
-
setChartConfiguration
public void setChartConfiguration(ChartConfiguration chartConfiguration)
-
setGenerateCharts
public void setGenerateCharts(boolean generateCharts)
-
-