public void Start(IApmContext apmContext, ApmHttpClientStartInformation apmHttpClientStartInformation) { var key = string.Empty; object counterProperty; if (!apmContext.TryGetValue(AverageTimeTakenMsCounter, 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(AverageTimeTakenMsCounter, counter); } object baseCounterProperty; if (!apmContext.TryGetValue(AverageTimeTakenMsBaseCounter, out baseCounterProperty)) { var categoryName = PerformanceCounterApmHttpClientDelegatingHandler.GetCategoryName(apmHttpClientStartInformation.ApplicationName); var counterName = GetBaseCounterName(apmHttpClientStartInformation.MethodIdentifier); var baseCounter = BaseCounters.GetOrAdd(key, s => GetBaseCounter(categoryName, _instanceName, counterName)); apmContext.Add(AverageTimeTakenMsBaseCounter, baseCounter); } }
public static void Start(IApmContext apmContext, ApmHttpClientStartInformation apmWebApiStartInformation) { foreach (var counter in CounterHandlers) { counter.Start(apmContext, apmWebApiStartInformation); } }
public static void Start(IApmContext apmContext, ApmHttpClientStartInformation apmWebApiStartInformation) { var message = string.Format("CS - Start - {0} - {1}", apmWebApiStartInformation.EventName, apmWebApiStartInformation.TraceId); var logger = Log.Logger; var logEvent = new LoggingEvent(DeclaringType, logger.Repository, logger.Name, Level.Info, message, null); foreach (var property in apmContext) { logEvent.Properties[property.Key] = property.Value; } logger.Log(logEvent); }
public static void Start(IApmContext apmContext, ApmHttpClientStartInformation apmWebApiStartInformation) { }
public static void Start(IApmContext apmContext, ApmHttpClientStartInformation apmWebApiStartInformation) { var message = string.Format("CS - Start - {0} - {1}", apmWebApiStartInformation.EventName, apmWebApiStartInformation.TraceId); Log.Log(message, LogLevel.Info, apmContext); }