Class PerfTask

    • Field Detail

      • logStep

        protected int logStep
      • params

        protected String params
      • NEW_LINE

        protected static final String NEW_LINE
      • stopNow

        protected volatile boolean stopNow
    • Constructor Detail

    • Method Detail

      • setRunInBackground

        public void setRunInBackground​(int deltaPri)
      • getRunInBackground

        public boolean getRunInBackground()
      • getBackgroundDeltaPriority

        public int getBackgroundDeltaPriority()
      • stopNow

        public void stopNow()
      • runAndMaybeStats

        public final int runAndMaybeStats​(boolean reportStats)
                                   throws Exception
        Run the task, record statistics.
        Returns:
        number of work items done by this task.
        Throws:
        Exception
      • doLogic

        public abstract int doLogic()
                             throws Exception
        Perform the task once (ignoring repetitions specification) Return number of work items done by this task. For indexing that can be number of docs added. For warming that can be number of scanned items, etc.
        Returns:
        number of work items done by this task.
        Throws:
        Exception
      • getName

        public String getName()
        Returns:
        Returns the name.
      • setName

        protected void setName​(String name)
        Parameters:
        name - The name to set.
      • getRunData

        public PerfRunData getRunData()
        Returns:
        Returns the run data.
      • getDepth

        public int getDepth()
        Returns:
        Returns the depth.
      • setDepth

        public void setDepth​(int depth)
        Parameters:
        depth - The depth to set.
      • getLogMessage

        protected String getLogMessage​(int recsCount)
      • shouldNeverLogAtStart

        protected boolean shouldNeverLogAtStart()
        Tasks that should never log at start can override this.
        Returns:
        true if this task should never log when it start.
      • shouldNotRecordStats

        protected boolean shouldNotRecordStats()
        Tasks that should not record statistics can override this.
        Returns:
        true if this task should never record its statistics.
      • setup

        public void setup()
                   throws Exception
        Task setup work that should not be measured for that specific task. By default it does nothing, but tasks can implement this, moving work from doLogic() to this method. Only the work done in doLogic() is measured for this task. Notice that higher level (sequence) tasks containing this task would then measure larger time than the sum of their contained tasks.
        Throws:
        Exception
      • tearDown

        public void tearDown()
                      throws Exception
        Task tearDown work that should not be measured for that specific task. By default it does nothing, but tasks can implement this, moving work from doLogic() to this method. Only the work done in doLogic() is measured for this task. Notice that higher level (sequence) tasks containing this task would then measure larger time than the sum of their contained tasks.
        Throws:
        Exception
      • supportsParams

        public boolean supportsParams()
        Sub classes that support parameters must override this method to return true.
        Returns:
        true iff this task supports command line params.
      • getParams

        public String getParams()
        Returns:
        Returns the Params.
      • isDisableCounting

        public boolean isDisableCounting()
        Return true if counting is disabled for this task.
      • setDisableCounting

        public void setDisableCounting​(boolean disableCounting)
      • setAlgLineNum

        public void setAlgLineNum​(int algLineNum)
      • getAlgLineNum

        public int getAlgLineNum()