Class ContentItemsSource
Base class for source of data for benchmarking.
Implements
Inherited Members
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
m_encoding
Base class for source of data for benchmarking.
Declaration
protected Encoding m_encoding
Field Value
Type | Description |
---|---|
Encoding |
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).
m_forever
Base class for source of data for benchmarking.
Declaration
protected bool m_forever
Field Value
Type | Description |
---|---|
bool |
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).
m_logStep
Base class for source of data for benchmarking.
Declaration
protected int m_logStep
Field Value
Type | Description |
---|---|
int |
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).
m_verbose
Base class for source of data for benchmarking.
Declaration
protected bool m_verbose
Field Value
Type | Description |
---|---|
bool |
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).
Properties
BytesCount
Returns the number of bytes generated since last reset.
Declaration
public long BytesCount { get; }
Property Value
Type | Description |
---|---|
long |
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).
Config
Base class for source of data for benchmarking.
Declaration
public Config Config { get; }
Property Value
Type | Description |
---|---|
Config |
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).
ItemsCount
Returns the number of generated items since last reset.
Declaration
public int ItemsCount { get; }
Property Value
Type | Description |
---|---|
int |
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).
TotalBytesCount
Returns the total number of bytes that were generated by this source.
Declaration
public long TotalBytesCount { get; }
Property Value
Type | Description |
---|---|
long |
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).
TotalItemsCount
Returns the total number of generated items.
Declaration
public int TotalItemsCount { get; }
Property Value
Type | Description |
---|---|
int |
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).
Methods
AddBytes(long)
update count of bytes generated by this source
Declaration
protected void AddBytes(long numBytes)
Parameters
Type | Name | Description |
---|---|---|
long | numBytes |
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).
AddItem()
update count of items generated by this source
Declaration
protected void AddItem()
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).
CollectFiles(DirectoryInfo, IList<FileInfo>)
A convenience method for collecting all the files of a content source from
a given directory. The collected FileInfo 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 |
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).
Dispose()
Called when reading from this content source is no longer required.
Declaration
public void Dispose()
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).
Dispose(bool)
Called when reading from this content source is no longer required.
Declaration
protected abstract void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing |
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).
PrintStatistics(string)
Base class for source of data for benchmarking.
Declaration
public virtual void PrintStatistics(string itemsName)
Parameters
Type | Name | Description |
---|---|---|
string | itemsName |
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).
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 callbase.ResetInputs()
in case you override this method.
Declaration
public virtual void ResetInputs()
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).
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 |
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).
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 |
---|---|
bool |
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).