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. |
key | Name of counter |
Read |
options | Read |
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);