public void Start(IApmContext apmContext, ApmWebApiStartInformation apmWebApiStartInformation) { var key = string.Empty; object counterProperty; if (!apmContext.TryGetValue(AverageTimeTakenMsCounter, out counterProperty)) { var categoryName = PerformanceCounterApmApiFilterAttribute.GetCategoryName(apmWebApiStartInformation.ApplicationName); var counterName = GetCounterName(apmWebApiStartInformation.MethodIdentifier); var counter = Counters.GetOrAdd(key, s => GetCounter(categoryName, _instanceName, counterName)); apmContext.Add(AverageTimeTakenMsCounter, counter); } object baseCounterProperty; if (!apmContext.TryGetValue(AverageTimeTakenMsBaseCounter, out baseCounterProperty)) { var categoryName = PerformanceCounterApmApiFilterAttribute.GetCategoryName(apmWebApiStartInformation.ApplicationName); var counterName = GetBaseCounterName(apmWebApiStartInformation.MethodIdentifier); var baseCounter = BaseCounters.GetOrAdd(key, s => GetBaseCounter(categoryName, _instanceName, counterName)); apmContext.Add(AverageTimeTakenMsBaseCounter, baseCounter); } }
public void Finish(IApmContext apmContext, ApmWebApiFinishInformation apmWebApiFinishInformation) { object counterProperty; if (apmContext.TryGetValue(AverageTimeTakenMsCounter, out counterProperty)) { var counter = (System.Diagnostics.PerformanceCounter)counterProperty; counter.IncrementBy(apmWebApiFinishInformation.ResponseTime); } object baseCounterProperty; if (apmContext.TryGetValue(AverageTimeTakenMsBaseCounter, out baseCounterProperty)) { var baseCounter = (System.Diagnostics.PerformanceCounter)baseCounterProperty; baseCounter.Increment(); } }
public void Finish(IApmContext apmContext, ApmWebApiFinishInformation apmWebApiFinishInformation) { object counterProperty; if (apmContext.TryGetValue(LastOperationExecutionTimeMsCounter, out counterProperty)) { var counter = (System.Diagnostics.PerformanceCounter)counterProperty; counter.Increment(); } }
public void Finish(IApmContext apmContext, ApmHttpClientFinishInformation apmHttpClientFinishInformation) { object counterProperty; if (apmContext.TryGetValue(LastOperationExecutionTimeMsCounter, out counterProperty)) { var counter = (System.Diagnostics.PerformanceCounter)counterProperty; counter.RawValue = apmHttpClientFinishInformation.ResponseTime; } }
public void Finish(IApmContext apmContext, ApmMethodHandlerFinishInformation apmMethodHandlerFinishInformation) { object counterProperty; if (apmContext.TryGetValue(TotalCountCounter, out counterProperty)) { var counter = (System.Diagnostics.PerformanceCounter)counterProperty; counter.Increment(); } }
public void Start(IApmContext apmContext, ApmHttpClientStartInformation apmHttpClientStartInformation) { var key = string.Empty; object counterProperty; if (!apmContext.TryGetValue(LastOperationExecutionTimeMsCounter, out counterProperty)) { var categoryName = PerformanceCounterApmHttpClientDelegatingHandler.GetCategoryName(apmHttpClientStartInformation.ApplicationName); var counterName = GetCounterName(apmHttpClientStartInformation.MethodIdentifier); var counter = Counters.GetOrAdd(key, s => GetCounter(categoryName, _instanceName, counterName)); apmContext.Add(LastOperationExecutionTimeMsCounter, counter); } }
public void Start(IApmContext apmContext, ApmMethodHandlerStartInformation apmMethodHandlerStartInformation) { var key = string.Empty; object counterProperty; if (!apmContext.TryGetValue(TotalCountCounter, out counterProperty)) { var categoryName = PerformanceCounterApmMethodHandler.GetCategoryName(apmMethodHandlerStartInformation.ApplicationName); var counterName = GetCounterName(apmMethodHandlerStartInformation.MethodIdentifier); var counter = Counters.GetOrAdd(key, s => GetCounter(categoryName, _instanceName, counterName)); apmContext.Add(TotalCountCounter, counter); } }