Class 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 Detail

      • clifReportDirectory

        protected final String clifReportDirectory
      • ouputDirectory

        protected final File ouputDirectory
      • dateEventFilter

        protected org.ow2.clif.storage.lib.util.DateEventFilter dateEventFilter
      • successfulResultPatterns

        protected final Map<String,​Pattern> successfulResultPatterns
      • actionAliasPatterns

        protected final Map<String,​Pattern> actionAliasPatterns
      • eventTypeToExclude

        protected final List<String> eventTypeToExclude
      • storageRead

        protected org.ow2.clif.storage.api.StorageRead storageRead
      • patternProbeName

        protected final Pattern patternProbeName
    • Constructor Detail

      • ClifParser

        public ClifParser​(String clifReportDirectory,
                          File ouputDirectory)
    • Method Detail

      • addDateFilter

        public void addDateFilter​(long from,
                                  long to)
      • addSuccessfulResultPattern

        public void addSuccessfulResultPattern​(String actionType,
                                               String pattern)
      • addActionAliasPattern

        public void addActionAliasPattern​(String actionAlias,
                                          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 value
        keepPercentage - percentage of value to keep
      • 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
      • extractTestPlanName

        protected static String extractTestPlanName​(String clifTestPlanName)
      • 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)
      • extractProbeSimpleName

        protected String extractProbeSimpleName​(String probeClassName)
      • toDouble

        protected static double toDouble​(Object value)
        Convert an object to a double value.
        Any Number 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)