Beispiel #1
0
        /// <inheritdoc />
        public Task <GetStatsResult> GetStatsAsync(Context context)
        {
            return(GetStatsCall <ContentStoreTracer> .RunAsync(_tracer, OperationContext(context), async() =>
            {
                var result = await InnerContentStore.GetStatsAsync(context);
                if (result.Succeeded)
                {
                    var counterSet = result.CounterSet;
                    if (_contentLocationStore != null)
                    {
                        var contentLocationStoreCounters = _contentLocationStore.GetCounters(context);
                        counterSet.Merge(contentLocationStoreCounters, "ContentLocationStore.");
                    }

                    if (_pinCache != null)
                    {
                        counterSet.Merge(_pinCache.GetCounters(context), "PinCache.");
                    }

                    return new GetStatsResult(counterSet);
                }

                return result;
            }));
        }
Beispiel #2
0
        /// <inheritdoc />
        public virtual Task <GetStatsResult> GetStatsAsync(Context context)
        {
            return(GetStatsCall <ContentStoreTracer> .RunAsync(
                       Tracer,
                       new OperationContext(context),
                       () =>
            {
                return Task.WhenAll(ContentStore1.GetStatsAsync(context), ContentStore2.GetStatsAsync(context))
                .ContinueWith(
                    antecedent =>
                {
                    if (antecedent.IsFaulted)
                    {
                        return new GetStatsResult(antecedent.Exception);
                    }

                    if (antecedent.IsCanceled)
                    {
                        return new GetStatsResult($"{nameof(GetStatsAsync)} is cancelled");
                    }

                    Contract.Assert(antecedent.Result.Length == 2);

                    var counterSet = new CounterSet();
                    counterSet.Merge(antecedent.Result[0].CounterSet, NameOfContentStore1 + ".");
                    counterSet.Merge(antecedent.Result[1].CounterSet, NameOfContentStore2 + ".");

                    return new GetStatsResult(counterSet);
                });
            }));
        }
 /// <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));
     }));
 }
Beispiel #4
0
        /// <inheritdoc />
        public Task <GetStatsResult> GetStatsAsync(Context context)
        {
            return(GetStatsCall <MemoizationStoreTracer> .RunAsync(Tracer, new OperationContext(context), () =>
            {
                var counters = new CounterSet();
                counters.Merge(Tracer.GetCounters(), $"{Component}.");
                counters.Merge(Tracer.GetSQLiteDatabaseCounters(), $"{Component}.");

                counters.Add($"{CurrentContentHashListCountName}", _currentRowCount);

                return Task.FromResult(new GetStatsResult(counters));
            }));
        }
Beispiel #5
0
 /// <inheritdoc />
 public virtual Task <GetStatsResult> GetStatsAsync(Context context)
 {
     return(GetStatsCall <ContentStoreTracer> .RunAsync(
                Tracer,
                new OperationContext(context),
                () =>
     {
         return Task.WhenAll(ContentStore1.GetStatsAsync(context), ContentStore2.GetStatsAsync(context))
         .ContinueWith(
             antecedent =>
         {
             if (antecedent.IsFaulted)
             {
                 return new GetStatsResult(antecedent.Exception !);
             }
        /// <inheritdoc />
        public Task <GetStatsResult> GetStatsAsync(Context context)
        {
            return(GetStatsCall <ContentStoreTracer> .RunAsync(
                       StoreTracer,
                       new OperationContext(context),
                       async() =>
            {
                CounterSet aggregatedCounters = new CounterSet();
                foreach (var kvp in DrivesWithContentStore)
                {
                    var stats = await kvp.Value.GetStatsAsync(context);
                    if (stats.Succeeded)
                    {
                        aggregatedCounters.Merge(stats.CounterSet, $"{kvp.Value.GetType().Name}.{kvp.Key}.");
                    }
                }

                return new GetStatsResult(aggregatedCounters);
            }));
        }
Beispiel #7
0
        /// <inheritdoc />
        public Task <GetStatsResult> GetStatsAsync(Context context)
        {
            return(GetStatsCall <ContentStoreTracer> .RunAsync(
                       ExecutionTracer,
                       OperationContext(context),
                       async() =>
            {
                CounterSet aggregatedCounters = new CounterSet();
                aggregatedCounters.Merge(SessionTracer.GetCounters(), $"{nameof(ServiceClientContentSession)}.");
                // Getting the stats from the remote as well.
                if (_grpcClient != null)
                {
                    var getStats = await _grpcClient.GetStatsAsync(context);
                    if (getStats.Succeeded)
                    {
                        aggregatedCounters.Merge(getStats.CounterSet, "ContentServer.");
                    }
                }

                return new GetStatsResult(aggregatedCounters);
            }));
        }
Beispiel #8
0
 public Task <GetStatsResult> GetStatsAsync(Context context)
 {
     return(GetStatsCall <Tracer> .RunAsync(Tracer, new OperationContext(context), () => GetStatsCoreAsync(context)));
 }
 /// <inheritdoc />
 public Task <GetStatsResult> GetStatsAsync(Context context)
 {
     return(GetStatsCall <BuildCacheCacheTracer> .RunAsync(_tracer, new OperationContext(context), () => GetStatsInternalAsync(context)));
 }
Beispiel #10
0
 /// <inheritdoc />
 public Task <GetStatsResult> GetStatsAsync(Context context)
 {
     return(GetStatsCall <MemoizationStoreTracer> .RunAsync(
                _tracer, OperationContext(context), () => Task.FromResult(new GetStatsResult(_tracer.GetCounters()))));
 }
Beispiel #11
0
 /// <inheritdoc />
 public Task <GetStatsResult> GetStatsAsync(Context context)
 {
     return(GetStatsCall <ContentStoreTracer> .RunAsync(_tracer, OperationContext(context), () => Store.GetStatsAsync(context)));
 }