/// <inheritdoc />
 public Task <GetStatsResult> GetStatsAsync(Context context)
 {
     return(GetStatsCall <MemoizationStoreTracer> .RunAsync(_tracer, new OperationContext(context), () =>
     {
         var counters = new CounterSet();
         counters.Merge(_tracer.GetCounters(), $"{_tracer.Name}.");
         return Task.FromResult(new GetStatsResult(counters));
     }));
 }
        /// <summary>
        /// Gets the counters collected by this tracer instance.
        /// </summary>
        public CounterSet GetCounters()
        {
            var aggregatedCounters = new CounterSet();

            aggregatedCounters.Merge(ContentSessionTracer.GetCounters());
            var countersStored = aggregatedCounters.ToDictionaryIntegral();

            foreach (var counter in MemoizationStoreTracer.GetCounters().ToDictionaryIntegral())
            {
                if (!countersStored.ContainsKey(counter.Key))
                {
                    aggregatedCounters.Add(counter.Key, counter.Value);
                }
            }

            foreach (Counter counter in _counters)
            {
                aggregatedCounters.Add(counter.Name, counter.Value);
            }

            return(aggregatedCounters);
        }
Beispiel #3
0
 /// <inheritdoc />
 public Task <GetStatsResult> GetStatsAsync(Context context)
 {
     return(GetStatsCall <MemoizationStoreTracer> .RunAsync(
                _tracer, OperationContext(context), () => Task.FromResult(new GetStatsResult(_tracer.GetCounters()))));
 }