Interface IReservoir
Provides access to a Reservoir Sampling implementation. Reservoir sampling is a family of randomized algorithms for randomly choosing a sample of k items from a list S containing n items, where n is either a very large or unknown number. Typically n is large enough that the list doesn't fit into main memory.
Namespace:App.Metrics.Abstractions.ReservoirSampling
Assembly:cs.temp.dll.dll
Syntax
public interface IReservoir
Methods
GetSnapshot()
Gets a statistical IReservoirSnapshot including percentiles of the current sample.
Declaration
IReservoirSnapshot GetSnapshot()
Returns
Type | Description |
---|---|
IReservoirSnapshot | A IReservoirSnapshot of the current sample |
GetSnapshot(Boolean)
Gets a statistical IReservoirSnapshot including percentiles of the current sample.
Declaration
IReservoirSnapshot GetSnapshot(bool resetReservoir)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | resetReservoir | if set to |
Returns
Type | Description |
---|---|
IReservoirSnapshot | A IReservoirSnapshot of the current sample |
Reset()
Reset all statistics, in addition to the underlying reservoir.
Declaration
void Reset()
Update(Int64)
Update statistics and the reservoir with a new sample.
Declaration
void Update(long value)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | value | The value. |
Update(Int64, String)
Update statistics and the reservoir with a new sample.
Declaration
void Update(long value, string userValue)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | value | The value. |
System.String | userValue | The user value. |