public static void Start(IApmContext apmContext, ApmWebApiStartInformation apmWebApiStartInformation)
 {
     foreach (var counter in CounterHandlers)
     {
         counter.Start(apmContext, apmWebApiStartInformation);
     }
 }
        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 static void Start(IApmContext apmContext, ApmWebApiStartInformation apmWebApiStartInformation)
        {
            var message  = string.Format("SR - Start - {0} - {1}", apmWebApiStartInformation.MethodIdentifier, 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, ApmWebApiStartInformation apmWebApiStartInformation)
 {
 }
Example #5
0
        public static void Start(IApmContext apmContext, ApmWebApiStartInformation apmWebApiStartInformation)
        {
            var message = string.Format("SR - Start - {0} - {1}", apmWebApiStartInformation.MethodIdentifier, apmWebApiStartInformation.TraceId);

            Log.Log(message, LogLevel.Info, apmContext);
        }