public PerfCounterCreationData(PerformanceCounterName name, PerformanceCounterType type, string displayName, string helpText) { counterName = name; counterType = type; counterDisplayName = displayName; counterHelpText = helpText; }
/// <summary> /// Try to update performance counter with speficied value. /// </summary> /// <param name="counterName">Counter to update.</param> /// <param name="value">New value.</param> internal void SetCounter(PerformanceCounterName counterName, long value) { if (_initialized) { PerformanceCounterWrapper pc; if (_counters.TryGetValue(counterName, out pc)) { pc.SetRawValue(value); } } }
/// <summary> /// Try to increment specified performance counter by 1 for current instance. /// </summary> /// <param name="counterName">Counter to increment.</param> internal void IncrementCounter(PerformanceCounterName counterName) { if (_initialized) { PerformanceCounterWrapper pc; if (_counters.TryGetValue(counterName, out pc)) { pc.Increment(); } } }
/// <summary> /// Invoked for updating specified performance counter for a cached shard map object. /// </summary> /// <param name="shardMap">Storage representation of a shard map.</param> /// <param name="name">Performance counter to increment.</param> public void IncrementPerformanceCounter(IStoreShardMap shardMap, PerformanceCounterName name) { using (ReadLockScope rls = _cacheRoot.GetReadLockScope(false)) { CacheShardMap csm = _cacheRoot.LookupById(shardMap.Id); if (csm != null) { using (ReadLockScope rlsShardMap = csm.GetReadLockScope(false)) { csm.IncrementPerformanceCounter(name); } } } }
public virtual void IncrementPerformanceCounter(IStoreShardMap shardMap, PerformanceCounterName name) { this.inner.IncrementPerformanceCounter(shardMap, name); }
/// <summary> /// Set raw value of performance counter. /// </summary> /// <param name="name">Performance counter to update.</param> /// <param name="value">Raw value for the counter.</param> /// <remarks>This method is always called from CacheStore inside csm.GetWriteLockScope() so we do not have to /// worry about multithreaded access here.</remarks> internal void SetPerformanceCounter(PerformanceCounterName name, long value) { this._perfCounters.SetCounter(name, value); }
/// <summary> /// Increment value of performance counter by 1. /// </summary> /// <param name="name">Name of performance counter to increment.</param> internal void IncrementPerformanceCounter(PerformanceCounterName name) { this._perfCounters.IncrementCounter(name); }