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()); }
/// <summary> /// Constructor. /// </summary> public RetrieveOltpStatisticsTask(IOptions <BalancerConfiguration> configuration, IStatisticsRepository repository, IStatisticsStorage storage, ILogger <RetrieveOltpStatisticsTask> logger) { _repository = repository; _storage = storage; _logger = logger; _configuration = configuration.Value; }
/// <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; }
/// <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 }); }
public StatsController(IStatisticsProxy statisticsProxy, IStatisticsStorage statisticsStorage) { Proxy = statisticsProxy; Storage = statisticsStorage; }
public StatsController(IStatisticsProxy statisticsProxy, IStatisticsStorage statisticsStorage) { Proxy = statisticsProxy; Storage = statisticsStorage; }
/// <inheritdoc /> public StatisticsController(IStatisticsStorage storage) => _storage = storage;