コード例 #1
0
        public StatisticsModule(ICommandDispatcher commandDispatcher,
                                IValidatorResolver validatorResolver,
                                IStatisticsStorage statisticsStorage)
            : base(commandDispatcher, validatorResolver, modulePath: "statistics")
        {
            Get("remarks", async args => await FetchCollection <BrowseRemarkStatistics, RemarkStatistics>
                    (async x => await statisticsStorage.BrowseRemarkStatisticsAsync(x))
                .HandleAsync());

            Get("remarks/{id}", async args => await Fetch <GetRemarkStatistics, RemarkStatistics>
                    (async x => await statisticsStorage.GetRemarkStatisticsAsync(x))
                .HandleAsync());

            Get("remarks/general", async args => await Fetch <GetRemarksCountStatistics, RemarksCountStatistics>
                    (async x => await statisticsStorage.GetRemarksCountStatisticsAsync(x))
                .HandleAsync());

            Get("categories", async args => await FetchCollection <BrowseCategoryStatistics, CategoryStatistics>
                    (async x => await statisticsStorage.BrowseCategoryStatisticsAsync(x))
                .HandleAsync());

            Get("tags", async args => await FetchCollection <BrowseTagStatistics, TagStatistics>
                    (async x => await statisticsStorage.BrowseTagStatisticsAsync(x))
                .HandleAsync());

            Get("users", async args => await FetchCollection <BrowseUserStatistics, UserStatistics>
                    (async x => await statisticsStorage.BrowseUserStatisticsAsync(x))
                .HandleAsync());

            Get("users/{id}", async args => await Fetch <GetUserStatistics, UserStatistics>
                    (async x => await statisticsStorage.GetUserStatisticsAsync(x))
                .HandleAsync());
        }
コード例 #2
0
 /// <summary>
 /// Constructor.
 /// </summary>
 public RetrieveOltpStatisticsTask(IOptions <BalancerConfiguration> configuration,
                                   IStatisticsRepository repository, IStatisticsStorage storage, ILogger <RetrieveOltpStatisticsTask> logger)
 {
     _repository    = repository;
     _storage       = storage;
     _logger        = logger;
     _configuration = configuration.Value;
 }
コード例 #3
0
 /// <summary>
 /// Constructor.
 /// </summary>
 public QueryDistributionService(IStatisticsStorage statisticsStorage, IResponseStorage responseStorage,
                                 IOptions <BalancerConfiguration> options, IQueryExecutor queryExecutor, IRequestQueue queue, IServerDecider decider)
 {
     _statisticsStorage = statisticsStorage;
     _queryExecutor     = queryExecutor;
     _responseStorage   = responseStorage;
     _queue             = queue;
     _configuration     = options.Value;
     _serverDecider     = decider;
 }
コード例 #4
0
 /// <summary>
 /// Add statistics (Online=true,SessionsCount) to chosen storage.
 /// </summary>
 protected static void SetLocalhostStatisticsAsOnline(IStatisticsStorage storage, int sessionsCount = 1)
 {
     storage.Set(QueryType.Oltp, new Server(), new Statistics {
         IsOnline = true, CurrentSessionsCount = sessionsCount
     });
 }
コード例 #5
0
 public StatsController(IStatisticsProxy statisticsProxy, IStatisticsStorage statisticsStorage)
 {
     Proxy   = statisticsProxy;
     Storage = statisticsStorage;
 }
コード例 #6
0
ファイル: StatsController.cs プロジェクト: supermuk/iudico
 public StatsController(IStatisticsProxy statisticsProxy, IStatisticsStorage statisticsStorage)
 {
     Proxy = statisticsProxy;
     Storage = statisticsStorage;
 }
コード例 #7
0
 /// <inheritdoc />
 public StatisticsController(IStatisticsStorage storage) => _storage = storage;