Show / Hide Table of Contents

    Class PerfTask

    An abstract task to be tested for performance.

    Inheritance
    System.Object
    PerfTask
    AddDocTask
    AddIndexesTask
    AnalyzerFactoryTask
    ClearStatsTask
    CloseIndexTask
    CloseReaderTask
    CloseTaxonomyIndexTask
    CloseTaxonomyReaderTask
    CommitIndexTask
    CommitTaxonomyIndexTask
    ConsumeContentSourceTask
    CreateIndexTask
    CreateTaxonomyIndexTask
    ForceMergeTask
    NearRealtimeReaderTask
    NewAnalyzerTask
    NewCollationAnalyzerTask
    NewLocaleTask
    NewRoundTask
    OpenIndexTask
    OpenReaderTask
    OpenTaxonomyIndexTask
    OpenTaxonomyReaderTask
    PrintReaderTask
    ReadTask
    ReadTokensTask
    ReopenReaderTask
    ReportTask
    ResetInputsTask
    RollbackIndexTask
    SetPropTask
    TaskSequence
    UpdateDocTask
    WaitForMergesTask
    WaitTask
    WriteLineDocTask
    Namespace: Lucene.Net.Benchmarks.ByTask.Tasks
    Assembly: Lucene.Net.Benchmark.dll
    Syntax
    public abstract class PerfTask : IDisposable
    Remarks

    Every performance task extends this class, and provides its own DoLogic() method, which performs the actual task.

    Tasks performing some work that should be measured for the task, can override Setup() and/or TearDown() and place that work there.

    Relevant properties:

    • task.max.depth.log

    Also supports the following logging attributes:

    • log.step specifies how often to log messages about the current running task. Default is 1000 DoLogic() invocations. Set to -1 to disable logging.
    • log.step.[class Task Name] specifies the same as 'log.step', only for a particular task name. For example, log.step.AddDoc will be applied only for AddDocTask. It's a way to control per task logging settings. If you want to omit logging for any other task, include log.step=-1. The syntax is "log.step." together with the Task's 'short' name (i.e., without the 'Task' part).

    Constructors

    | Improve this Doc View Source

    PerfTask(PerfRunData)

    Declaration
    public PerfTask(PerfRunData runData)
    Parameters
    Type Name Description
    PerfRunData runData

    Fields

    | Improve this Doc View Source

    m_logStep

    Declaration
    protected int m_logStep
    Field Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    m_params

    Declaration
    protected string m_params
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    NEW_LINE

    Declaration
    protected static readonly string NEW_LINE
    Field Value
    Type Description
    System.String

    Properties

    | Improve this Doc View Source

    AlgLineNum

    Declaration
    public virtual int AlgLineNum { get; set; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    BackgroundDeltaPriority

    Declaration
    public virtual int BackgroundDeltaPriority { get; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    Depth

    Gets or Sets the depth.

    Declaration
    public virtual int Depth { get; set; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    DisableCounting

    Return true if counting is disabled for this task.

    Declaration
    public virtual bool DisableCounting { get; set; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Params

    Gets the Params.

    Declaration
    public virtual string Params { get; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    RunData

    Gets the run data.

    Declaration
    public virtual PerfRunData RunData { get; }
    Property Value
    Type Description
    PerfRunData
    | Improve this Doc View Source

    RunInBackground

    Declaration
    public virtual bool RunInBackground { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    ShouldNeverLogAtStart

    Tasks that should never log at start can override this. Returns true if this task should never log when it start.

    Declaration
    protected virtual bool ShouldNeverLogAtStart { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    ShouldNotRecordStats

    Tasks that should not record statistics can override this. Returns true if this task should never record its statistics.

    Declaration
    protected virtual bool ShouldNotRecordStats { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Stop

    Declaration
    protected bool Stop { get; set; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    SupportsParams

    Sub classes that support parameters must override this method to return true if this task supports command line params.

    Declaration
    public virtual bool SupportsParams { get; }
    Property Value
    Type Description
    System.Boolean

    Methods

    | Improve this Doc View Source

    Clone()

    Declaration
    public virtual object Clone()
    Returns
    Type Description
    System.Object
    | Improve this Doc View Source

    Dispose()

    Declaration
    public void Dispose()
    | Improve this Doc View Source

    Dispose(Boolean)

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing
    | Improve this Doc View Source

    DoLogic()

    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.

    Declaration
    public abstract int DoLogic()
    Returns
    Type Description
    System.Int32

    Number of work items done by this task.

    | Improve this Doc View Source

    GetLogMessage(Int32)

    Declaration
    protected virtual string GetLogMessage(int recsCount)
    Parameters
    Type Name Description
    System.Int32 recsCount
    Returns
    Type Description
    System.String
    | Improve this Doc View Source

    GetName()

    Returns the name.

    Declaration
    public virtual string GetName()
    Returns
    Type Description
    System.String
    | Improve this Doc View Source

    RunAndMaybeStats(Boolean)

    Run the task, record statistics.

    Declaration
    public int RunAndMaybeStats(bool reportStats)
    Parameters
    Type Name Description
    System.Boolean reportStats
    Returns
    Type Description
    System.Int32

    Number of work items done by this task.

    | Improve this Doc View Source

    SetName(String)

    Sets the name.

    Declaration
    protected virtual void SetName(string name)
    Parameters
    Type Name Description
    System.String name

    The name to set.

    | Improve this Doc View Source

    SetParams(String)

    Set the params of this task.

    Declaration
    public virtual void SetParams(string params)
    Parameters
    Type Name Description
    System.String params
    | Improve this Doc View Source

    SetRunInBackground(Int32)

    Declaration
    public virtual void SetRunInBackground(int deltaPri)
    Parameters
    Type Name Description
    System.Int32 deltaPri
    | Improve this Doc View Source

    Setup()

    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.

    Declaration
    public virtual void Setup()
    | Improve this Doc View Source

    StopNow()

    Declaration
    public virtual void StopNow()
    | Improve this Doc View Source

    TearDown()

    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.

    Declaration
    public virtual void TearDown()
    | Improve this Doc View Source

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)