Method GetCounter
GetCounter(String, ReadThruOptions)
Returns instance of the counter specified with backing source Read Thru option.
Declaration
ICounter GetCounter(string key, ReadThruOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | Name of counter |
ReadThruOptions | options | ReadThruOptions to read from data source. These can be either ReadThru, ReadThruForced or None |
Returns
Type | Description |
---|---|
ICounter | Interface for using counters |
Examples
This example demonstrates how to get a distributed counter handler from ICache.
ICache cache = CacheManager.GetCache("myCache");
string dataTypeName = "DistributedCounter";
ICounter counter = cache.DataTypeManager.GetCounter(dataTypeName);