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
| Improve this Doc View Sourcem_encoding
Declaration
protected Encoding m_encoding
  Field Value
| Type | Description | 
|---|---|
| System.Text.Encoding | 
m_forever
Declaration
protected bool m_forever
  Field Value
| Type | Description | 
|---|---|
| System.Boolean | 
m_logStep
Declaration
protected int m_logStep
  Field Value
| Type | Description | 
|---|---|
| System.Int32 | 
m_verbose
Declaration
protected bool m_verbose
  Field Value
| Type | Description | 
|---|---|
| System.Boolean | 
Properties
| Improve this Doc View SourceBytesCount
Returns the number of bytes generated since last reset.
Declaration
public long BytesCount { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Int64 | 
Config
Declaration
public Config Config { get; }
  Property Value
| Type | Description | 
|---|---|
| Config | 
ItemsCount
Returns the number of generated items since last reset.
Declaration
public int ItemsCount { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
TotalBytesCount
Returns the total number of bytes that were generated by this source.
Declaration
public long TotalBytesCount { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Int64 | 
TotalItemsCount
Returns the total number of generated items.
Declaration
public int TotalItemsCount { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
Methods
| Improve this Doc View SourceAddBytes(Int64)
update count of bytes generated by this source
Declaration
protected void AddBytes(long numBytes)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.Int64 | numBytes | 
AddItem()
update count of items generated by this source
Declaration
protected void AddItem()
  CollectFiles(DirectoryInfo, IList<FileInfo>)
A convenience method for collecting all the files of a content source from
a given directory. The collected System.IO.FileInfo instances are stored in the
given files.
Declaration
protected void CollectFiles(DirectoryInfo dir, IList<FileInfo> files)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.IO.DirectoryInfo | dir | |
| System.Collections.Generic.IList<System.IO.FileInfo> | files | 
Dispose()
Called when reading from this content source is no longer required.
Declaration
public void Dispose()
  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 | 
PrintStatistics(String)
Declaration
public virtual void PrintStatistics(string itemsName)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | itemsName | 
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()
  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 | 
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 |