Ejemplo n.º 1
0
        public async Task Execute(IJobExecutionContext context)
        {
            _storage = _storage ?? ServiceContainer.provider.GetService(typeof(IHttpReportsStorage)) as IHttpReportsStorage;
            _options = _options ?? (ServiceContainer.provider.GetService(typeof(IOptions <DashboardOptions>)) as IOptions <DashboardOptions>).Value;

            await _storage.ClearData(DateTime.Now.AddDays(-_options.ExpireDay).ToString("yyyy-MM-dd"));
        }
 public HttpReportsDataController(IHttpReportsStorage storage, MonitorService monitorService, ScheduleService scheduleService, LanguageService languageService)
 {
     _storage         = storage;
     _monitorService  = monitorService;
     _scheduleService = scheduleService;
     _lang            = languageService.GetLanguage().Result;
 }
 public HttpCollectorMiddleware(RequestDelegate next, IHttpReportsStorage storage, JsonSerializerOptions jsonSetting, ILogger <HttpCollectorMiddleware> logger)
 {
     _next        = next;
     _logger      = logger;
     _jsonSetting = jsonSetting;
     _storage     = storage;
 }
Ejemplo n.º 4
0
 public QuartzSchedulerService(IJobFactory jobFactory, QuartzLogProvider quartzLogProvider, ILogger <QuartzSchedulerService> logger, IHttpReportsStorage storage)
 {
     JobFactory        = jobFactory;
     QuartzLogProvider = quartzLogProvider;
     Logger            = logger;
     _storage          = storage;
 }
Ejemplo n.º 5
0
 public DashboardDataHandle(IServiceProvider serviceProvider, IAuthService authService, IHttpReportsStorage storage, IScheduleService scheduleService, ILocalizeService localizeService) : base(serviceProvider)
 {
     _storage         = storage;
     _scheduleService = scheduleService;
     _localizeService = localizeService;
     _authService     = authService;
 }
Ejemplo n.º 6
0
 public DashboardDataHandle(IServiceProvider serviceProvider, IHttpReportsStorage storage, MonitorService monitorService, ScheduleService scheduleService, LocalizeService localizeService) : base(serviceProvider)
 {
     _storage         = storage;
     _monitorService  = monitorService;
     _scheduleService = scheduleService;
     _localizeService = localizeService;
 }
Ejemplo n.º 7
0
 public DashboardDataHandle(IServiceProvider serviceProvider, IHttpReportsStorage storage, MonitorService monitorService, ScheduleService scheduleService, LanguageService languageService) : base(serviceProvider)
 {
     _storage         = storage;
     _monitorService  = monitorService;
     _scheduleService = scheduleService;
     _lang            = languageService.GetLanguage().Result;
 }
Ejemplo n.º 8
0
 public DashboardHandle(IServiceProvider serviceProvider, IHttpReportsStorage storage, IOptions <DashboardOptions> options, LocalizeService localizeService) : base(serviceProvider)
 {
     _storage         = storage;
     _options         = options;
     _localizeService = localizeService;
     _lang            = _localizeService.Current;
 }
Ejemplo n.º 9
0
 public AlarmService(IOptions <DashboardOptions> options, ILogger <AlarmService> logger, ILocalizeService localizeService, IHttpReportsStorage storage)
 {
     Options          = options.Value;
     Logger           = logger;
     _localizeService = localizeService;
     _storage         = storage;
 }
Ejemplo n.º 10
0
        public ScheduleService(IHttpReportsStorage storage, IOptions <DashboardOptions> options, LanguageService languageService)
        {
            _storage = storage;

            _options = options.Value;

            scheduler = scheduler ?? new StdSchedulerFactory().GetScheduler().Result;
        }
 public HttpReportsBackgroundService(IOptions <HttpReportsOptions> options, IConfiguration configuration, ILogger <HttpReportsBackgroundService> logger, IHttpContextAccessor contextAccessor, IHttpReportsStorage storage, IPerformanceService performanceService)
 {
     _logger             = logger;
     _performanceService = performanceService;
     _storage            = storage;
     _config             = configuration;
     _options            = options?.Value;
 }
Ejemplo n.º 12
0
 public DashboardDataHandle(IServiceProvider serviceProvider, IOptions <DashboardOptions> options, IHealthCheckService healthCheckService, IAuthService authService, IHttpReportsStorage storage, IScheduleService scheduleService, ILocalizeService localizeService) : base(serviceProvider)
 {
     _storage            = storage;
     _options            = options.Value;
     _scheduleService    = scheduleService;
     _localizeService    = localizeService;
     _authService        = authService;
     _healthCheckService = healthCheckService;
 }
Ejemplo n.º 13
0
        public ScheduleService(IHttpReportsStorage storage, JsonSerializerOptions jsonSetting, IOptions <DashboardOptions> options)
        {
            _storage = storage;

            _options = options.Value;

            _jsonSetting = jsonSetting;

            scheduler = scheduler ?? new StdSchedulerFactory().GetScheduler().Result;
        }
Ejemplo n.º 14
0
        public async Task Execute(IJobExecutionContext context)
        {
            _storage            = _storage ?? ServiceContainer.provider.GetService(typeof(IHttpReportsStorage)) as IHttpReportsStorage;
            _options            = _options ?? (ServiceContainer.provider.GetService(typeof(IOptions <DashboardOptions>)) as IOptions <DashboardOptions>).Value;
            _healthCheckService = ServiceContainer.provider.GetService(typeof(IHealthCheckService)) as IHealthCheckService;
            _httpClientFactory  = ServiceContainer.provider.GetService(typeof(IHttpClientFactory)) as IHttpClientFactory;

            _logger = _logger ?? ServiceContainer.provider.GetService(typeof(ILogger <HealthCheckJob>)) as ILogger <HealthCheckJob>;

            await CheckAsync();
        }
Ejemplo n.º 15
0
 public MonitorBackendJob(IHttpReportsStorage storage,
                          IAlarmService alarmService,
                          MonitorService monitorService,
                          ILogger <MonitorBackendJob> logger,
                          LocalizeService localizeService)
 {
     _storage         = storage;
     _alarmService    = alarmService;
     _monitorService  = monitorService;
     _logger          = logger;
     _localizeService = localizeService;
 }
 public DashboardDataProvideService(IServiceProvider serviceProvider,
                                    IHttpContextAccessor contextAccessor,
                                    IHttpReportsStorage storage,
                                    MonitorService monitorService,
                                    QuartzSchedulerService scheduleService,
                                    LocalizeService localizeService)
 {
     _serviceProvider = serviceProvider;
     _contextAccessor = contextAccessor;
     _storage         = storage;
     _monitorService  = monitorService;
     _scheduleService = scheduleService;
     _localize        = localizeService.Current;
 }
Ejemplo n.º 17
0
        public async Task Execute(IJobExecutionContext context)
        {
            _storage      = _storage ?? ServiceContainer.provider.GetService(typeof(IHttpReportsStorage)) as IHttpReportsStorage;
            _alarmService = _alarmService ?? ServiceContainer.provider.GetService(typeof(IAlarmService)) as IAlarmService;
            _logger       = _logger ?? ServiceContainer.provider.GetService(typeof(ILogger <MonitorBackendJob>)) as ILogger <MonitorBackendJob>;
            _lang         = _lang ?? (ServiceContainer.provider.GetService(typeof(ILocalizeService)) as ILocalizeService).Current;

            MonitorJob job = context.JobDetail.JobDataMap.Get("job") as MonitorJob;

            MonitorJobPayload payload = JsonConvert.DeserializeObject <MonitorJobPayload>(job.Payload);

            var response = GetCheckResponse(new List <Func <MonitorJob, MonitorJobPayload, Task <AlarmOption> > > {
                ResponseTimeTask, ResponseErrorTask, RequestCountTask
            }, job, payload);

            await AlarmAsync(response.Select(x => x.Result).ToList(), job);
        }
Ejemplo n.º 18
0
 public HttpReportsController(IHttpReportsStorage storage)
 {
     _storage = storage;
 }
Ejemplo n.º 19
0
        public ScheduleService(IHttpReportsStorage storage)
        {
            _storage = storage;

            scheduler = scheduler ?? new StdSchedulerFactory().GetScheduler().Result;
        }
Ejemplo n.º 20
0
 public LocalizeService(IHttpReportsStorage storage, ILogger <LocalizeService> logger, JsonSerializerOptions jsonSetting)
 {
     _storage     = storage ?? throw new ArgumentNullException(nameof(storage));
     _logger      = logger;
     _jsonSetting = jsonSetting;
 }
Ejemplo n.º 21
0
 public HttpReportsController(IHttpReportsStorage storage, IOptions <DashboardOptions> options)
 {
     _storage = storage;
     _options = options;
 }
Ejemplo n.º 22
0
 public LocalizeService(IOptions <DashboardAPIOptions> options, IHttpReportsStorage storage, ILogger <LocalizeService> logger)
 {
     _options = options?.Value ?? throw new ArgumentNullException(nameof(options));
     _storage = storage ?? throw new ArgumentNullException(nameof(storage));
     _logger  = logger;
 }
Ejemplo n.º 23
0
 public ClearReportsDataJob(IHttpReportsStorage storage, IOptions <DashboardAPIOptions> options)
 {
     _storage = storage;
     _options = options.Value;
 }
Ejemplo n.º 24
0
 public DirectlyReportsTransport(IHttpReportsStorage storage)
 {
     Storage = storage;
 }
 public DefaultHttpInvokeProcesser(IHttpReportsStorage storage, IRequestInfoBuilder requestInfoBuilder, IConfiguration configuration)
 {
     Storage            = storage;
     RequestInfoBuilder = requestInfoBuilder;
     Configuration      = configuration;
 }
Ejemplo n.º 26
0
 public LocalizeService(IHttpReportsStorage storage, ILogger <LocalizeService> logger)
 {
     _storage = storage ?? throw new ArgumentNullException(nameof(storage));
     _logger  = logger;
 }
Ejemplo n.º 27
0
 public HttpCollectorService(IHttpReportsStorage storage)
 {
     Storage = storage;
 }
Ejemplo n.º 28
0
 public DashboardHandle(IServiceProvider serviceProvider, IHttpReportsStorage storage, IOptions <DashboardOptions> options, LanguageService language) : base(serviceProvider)
 {
     _storage  = storage;
     _options  = options;
     _language = language;
 }
Ejemplo n.º 29
0
 public HttpReportsDataController(IHttpReportsStorage storage, MonitorService monitorService, ScheduleService scheduleService)
 {
     _storage         = storage;
     _monitorService  = monitorService;
     _scheduleService = scheduleService;
 }
Ejemplo n.º 30
0
 public HealthCheckService(IHttpReportsStorage storage)
 {
     _storage       = storage;
     ExpireDateTime = DateTime.Now.AddSeconds(-3);
 }