C# Класс HdrHistogram.IntConcurrentHistogram

An integer values High Dynamic Range (HDR) Histogram that supports safe concurrent recording operations.
A IntConcurrentHistogram guarantees lossless recording of values into the histogram even when the histogram is updated by multiple threads.

It is important to note that concurrent recording is the only thread-safe behavior provided by IntConcurrentHistogram. It provides no implicit synchronization that would prevent the contents of the histogram from changing during other operations. These non-synchronised operations include queries, iterations, copies, or addition operations on the histogram. Concurrent updates that would safely work in the presence of queries, copies, or additions of histogram objects should use the Recorder which is intended for this purpose.

Наследование: HistogramBase
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Copy ( ) : HistogramBase

Copies the data from this instance to a new instance.

IntConcurrentHistogram ( long lowestTrackableValue, long highestTrackableValue, int numberOfSignificantValueDigits ) : System

Construct a IntConcurrentHistogram given the lowest and highest values to be tracked and a number of significant decimal digits. Providing a lowestTrackableValue is useful is situations where the units used for the histogram's values are much smaller that the minimal accuracy required. For example when tracking time values stated in nanoseconds, where the minimal accuracy required is a microsecond, the proper value for lowestTrackableValue would be 1000.

IntConcurrentHistogram ( long instanceId, long lowestTrackableValue, long highestTrackableValue, int numberOfSignificantValueDigits ) : System

Construct a IntConcurrentHistogram given the lowest and highest values to be tracked and a number of significant decimal digits.

Providing a lowestTrackableValue is useful in situations where the units used for the histogram's values are much smaller that the minimal accuracy required. For example when tracking time values stated in ticks (100 nanoseconds), where the minimal accuracy required is a microsecond, the proper value for lowestTrackableValue would be 10.

Защищенные методы

Метод Описание
AddToCountAtIndex ( int index, long addend ) : void

Adds the specified amount to the count of the provided index. Also increments the HistogramBase.TotalCount by the same amount.

ClearCounts ( ) : void

Clears the counts of this implementation.

CopyCountsInto ( long target ) : void

Copies the internal counts array into the supplied array.

GetCountAtIndex ( int index ) : long

Gets the number of recorded values at a given index.

IncrementCountAtIndex ( int index ) : void

Increments the count at the given index. Will also increment the HistogramBase.TotalCount.

SetCountAtIndex ( int index, long value ) : void

Sets the count at the given index.

Описание методов

AddToCountAtIndex() защищенный Метод

Adds the specified amount to the count of the provided index. Also increments the HistogramBase.TotalCount by the same amount.
protected AddToCountAtIndex ( int index, long addend ) : void
index int The index to increment.
addend long The amount to increment by.
Результат void

ClearCounts() защищенный Метод

Clears the counts of this implementation.
protected ClearCounts ( ) : void
Результат void

Copy() публичный Метод

Copies the data from this instance to a new instance.
public Copy ( ) : HistogramBase
Результат HistogramBase

CopyCountsInto() защищенный Метод

Copies the internal counts array into the supplied array.
protected CopyCountsInto ( long target ) : void
target long The array to write each count value into.
Результат void

GetCountAtIndex() защищенный Метод

Gets the number of recorded values at a given index.
protected GetCountAtIndex ( int index ) : long
index int The index to get the count for
Результат long

IncrementCountAtIndex() защищенный Метод

Increments the count at the given index. Will also increment the HistogramBase.TotalCount.
protected IncrementCountAtIndex ( int index ) : void
index int The index to increment the count at.
Результат void

IntConcurrentHistogram() публичный Метод

Construct a IntConcurrentHistogram given the lowest and highest values to be tracked and a number of significant decimal digits. Providing a lowestTrackableValue is useful is situations where the units used for the histogram's values are much smaller that the minimal accuracy required. For example when tracking time values stated in nanoseconds, where the minimal accuracy required is a microsecond, the proper value for lowestTrackableValue would be 1000.
public IntConcurrentHistogram ( long lowestTrackableValue, long highestTrackableValue, int numberOfSignificantValueDigits ) : System
lowestTrackableValue long /// The lowest value that can be tracked (distinguished from 0) by the histogram. /// Must be a positive integer that is >= 1. /// May be internally rounded down to nearest power of 2. ///
highestTrackableValue long The highest value to be tracked by the histogram. Must be a positive integer that is >= (2 * ).
numberOfSignificantValueDigits int The number of significant decimal digits to which the histogram will maintain value resolution and separation. /// Must be a non-negative integer between 0 and 5.
Результат System

IntConcurrentHistogram() публичный Метод

Construct a IntConcurrentHistogram given the lowest and highest values to be tracked and a number of significant decimal digits.
Providing a lowestTrackableValue is useful in situations where the units used for the histogram's values are much smaller that the minimal accuracy required. For example when tracking time values stated in ticks (100 nanoseconds), where the minimal accuracy required is a microsecond, the proper value for lowestTrackableValue would be 10.
public IntConcurrentHistogram ( long instanceId, long lowestTrackableValue, long highestTrackableValue, int numberOfSignificantValueDigits ) : System
instanceId long An identifier for this instance.
lowestTrackableValue long The lowest value that can be tracked (distinguished from 0) by the histogram. /// Must be a positive integer that is >= 1. /// May be internally rounded down to nearest power of 2. ///
highestTrackableValue long The highest value to be tracked by the histogram. /// Must be a positive integer that is >= (2 * lowestTrackableValue). ///
numberOfSignificantValueDigits int /// The number of significant decimal digits to which the histogram will maintain value resolution and separation. /// Must be a non-negative integer between 0 and 5. ///
Результат System

SetCountAtIndex() защищенный Метод

Sets the count at the given index.
protected SetCountAtIndex ( int index, long value ) : void
index int The index to be set
value long The value to set
Результат void