Пример #1
0
 /// <summary>
 /// Trace stats during component's shutdown.
 /// </summary>
 public void TraceStatisticsAtShutdown(Context context, CounterSet counterSet, string?prefix = null)
 {
     if (EnableTraceStatisticsAtShutdown)
     {
         if (string.IsNullOrEmpty(prefix))
         {
             // Trace(Severity.Debug, context, message);
             counterSet.LogOrderedNameValuePairs(s => Trace(Severity.Debug, context, s, operation: nameof(TraceStatisticsAtShutdown)));
         }
         else
         {
             counterSet.LogOrderedNameValuePairs(s => Trace(Severity.Debug, context, $"{prefix}.{s}", operation: nameof(TraceStatisticsAtShutdown)));
         }
     }
 }
Пример #2
0
        /// <inheritdoc />
        protected override async Task <BoolResult> ShutdownCoreAsync(OperationContext operationContext)
        {
            var result = await RetryPolicy.ExecuteAsync(() => RpcClient.ShutdownAsync(operationContext));

            var counterSet = new CounterSet();

            counterSet.Merge(GetCounters(), $"{Tracer.Name}.");
            counterSet.LogOrderedNameValuePairs(s => Tracer.Debug(operationContext, s));

            return(result);
        }
Пример #3
0
        /// <summary>
        /// Trace stats during component's shutdown.
        /// </summary>
        public void TraceStatisticsAtShutdown(Context context, CounterSet counterSet, string extraMessage = null)
        {
            if (EnableTraceStatisticsAtShutdown)
            {
                if (!string.IsNullOrEmpty(extraMessage))
                {
                    context.Debug(extraMessage);
                }

                counterSet.LogOrderedNameValuePairs(s => Debug(context, s));
            }
        }