Show / Hide Table of Contents

    Class ContentItemsSource

    Base class for source of data for benchmarking.

    Inheritance
    System.Object
    ContentItemsSource
    ContentSource
    FacetSource
    Namespace: Lucene.Net.Benchmarks.ByTask.Feeds
    Assembly: Lucene.Net.Benchmark.dll
    Syntax
    public abstract class ContentItemsSource : IDisposable
    Remarks

    Keeps track of various statistics, such as how many data items were generated, size in bytes etc.

    Supports the following configuration parameters:

    • content.source.foreverspecifies whether to generate items forever (default=true).
    • content.source.verbosespecifies whether messages should be output by the content source (default=false).
    • content.source.encoding specifies which encoding to use when reading the files of that content source. Certain implementations may define a default value if this parameter is not specified. (default=null).
    • content.source.log.step specifies for how many items a message should be logged. If set to 0 it means no logging should occur. NOTE: if verbose is set to false, logging should not occur even if logStep is not 0 (default=0).

    Fields

    | Improve this Doc View Source

    m_encoding

    Declaration
    protected Encoding m_encoding
    Field Value
    Type Description
    Encoding
    | Improve this Doc View Source

    m_forever

    Declaration
    protected bool m_forever
    Field Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    m_logStep

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

    m_verbose

    Declaration
    protected bool m_verbose
    Field Value
    Type Description
    System.Boolean

    Properties

    | Improve this Doc View Source

    BytesCount

    Returns the number of bytes generated since last reset.

    Declaration
    public long BytesCount { get; }
    Property Value
    Type Description
    System.Int64
    | Improve this Doc View Source

    Config

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

    ItemsCount

    Returns the number of generated items since last reset.

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

    TotalBytesCount

    Returns the total number of bytes that were generated by this source.

    Declaration
    public long TotalBytesCount { get; }
    Property Value
    Type Description
    System.Int64
    | Improve this Doc View Source

    TotalItemsCount

    Returns the total number of generated items.

    Declaration
    public int TotalItemsCount { get; }
    Property Value
    Type Description
    System.Int32

    Methods

    | Improve this Doc View Source

    AddBytes(Int64)

    update count of bytes generated by this source

    Declaration
    protected void AddBytes(long numBytes)
    Parameters
    Type Name Description
    System.Int64 numBytes
    | Improve this Doc View Source

    AddItem()

    update count of items generated by this source

    Declaration
    protected void AddItem()
    | Improve this Doc View Source

    CollectFiles(DirectoryInfo, IList<FileInfo>)

    A convenience method for collecting all the files of a content source from a given directory. The collected instances are stored in the given files.

    Declaration
    protected void CollectFiles(DirectoryInfo dir, IList<FileInfo> files)
    Parameters
    Type Name Description
    DirectoryInfo dir
    IList<FileInfo> files
    | Improve this Doc View Source

    Dispose()

    Called when reading from this content source is no longer required.

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

    Dispose(Boolean)

    Called when reading from this content source is no longer required.

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

    PrintStatistics(String)

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

    ResetInputs()

    Resets the input for this content source, so that the test would behave as if it was just started, input-wise.

    NOTE: the default implementation resets the number of bytes and items generated since the last reset, so it's important to call base.ResetInputs() in case you override this method.

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

    SetConfig(Config)

    Sets the Config for this content source. If you override this method, you must call base.SetConfig(config).

    Declaration
    public virtual void SetConfig(Config config)
    Parameters
    Type Name Description
    Config config
    | Improve this Doc View Source

    ShouldLog()

    Returns true whether it's time to log a message (depending on verbose and the number of items generated).

    Declaration
    protected bool ShouldLog()
    Returns
    Type Description
    System.Boolean
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)