public Task <IEnumerable <Aggregation> > LoadAllStatisticalDataAggregations(IStatisticalDataProvider dataProvider)
        {
            var dp           = (InMemoryStatisticalDataProvider)dataProvider;
            var dpAcc        = new ObjectAccessor(dp);
            var aggregations = (List <Aggregation>)dpAcc.GetFieldOrProperty("Aggregations");

            return(Task.FromResult((IEnumerable <Aggregation>)aggregations));
        }
 public StatisticalDataAggregationController(IStatisticalDataProvider statDataProvider,
                                             IEnumerable <IStatisticalDataAggregator> aggregators,
                                             IOptions <StatisticsOptions> options,
                                             ILogger <StatisticalDataAggregationController> logger)
 {
     _statDataProvider = statDataProvider;
     _aggregators      = aggregators;
     _options          = options.Value;
     _logger           = logger;
 }
        public Task DeleteAllStatisticalDataAsync(IStatisticalDataProvider dataProvider)
        {
            var dp      = (InMemoryStatisticalDataProvider)dataProvider;
            var dpAcc   = new ObjectAccessor(dp);
            var storage = (List <StatisticalDataRecord>)dpAcc.GetFieldOrProperty("Storage");

            storage.Clear();
            var aggregations = (List <Aggregation>)dpAcc.GetFieldOrProperty("Aggregations");

            aggregations.Clear();
            return(Task.CompletedTask);
        }
예제 #4
0
 /// <summary>
 /// Sets the current <see cref="IStatisticalDataProvider"/> instance.
 /// </summary>
 /// <param name="builder">The IRepositoryBuilder instance.</param>
 /// <param name="provider">The extension instance to set.</param>
 /// <returns>The updated IRepositoryBuilder.</returns>
 public static IRepositoryBuilder UseStatisticalDataProvider(this IRepositoryBuilder builder, IStatisticalDataProvider provider)
 {
     Providers.Instance.SetProvider(typeof(IStatisticalDataProvider), provider);
     return(builder);
 }
예제 #5
0
 public StatisticalDataCollector(IStatisticalDataProvider statDataProvider)
 {
     _statDataProvider = statDataProvider;
 }
        public Task <IEnumerable <IStatisticalDataRecord> > LoadAllStatisticalDataRecords(IStatisticalDataProvider dataProvider)
        {
            var dp      = (InMemoryStatisticalDataProvider)dataProvider;
            var dpAcc   = new ObjectAccessor(dp);
            var storage = (List <StatisticalDataRecord>)dpAcc.GetFieldOrProperty("Storage");

            return(Task.FromResult((IEnumerable <IStatisticalDataRecord>)storage));
        }