@Test public void testGaugesCountPendingJobsForNonDynamicGroup() throws Exception { JobDetail job; TriggerBuilder<Trigger> builder; job = newJob(Test1Job.class).withIdentity(testIdWatcher.getEntityName("Test1Job"), MY_GROUP).build(); builder = TriggerBuilder.newTrigger() .forJob(job) .startAt(Date.from(ZonedDateTime.now().plusMinutes(5).toInstant())); scheduler.scheduleJob(job, builder.build()); job = newJob(Test2Job.class).withIdentity(testIdWatcher.getEntityName("Test2Job"), MY_GROUP).build(); builder = TriggerBuilder.newTrigger() .forJob(job) .startAt(Date.from(ZonedDateTime.now().plusMinutes(5).toInstant())); scheduler.scheduleJob(job, builder.build()); task.reportPendingJobs(); RequiredSearch search1 = meterRegistry.get("quartz.pending.jobs") .tag("jobGroup", MY_GROUP) .tag("jobClass", "QuartzPendingJobsReportingTaskTest$Test1Job"); RequiredSearch search2 = meterRegistry.get("quartz.pending.jobs") .tag("jobGroup", MY_GROUP) .tag("jobClass", "QuartzPendingJobsReportingTaskTest$Test2Job"); await.untilAsserted(() -> assertThat(search1.gauge().value()).isEqualTo(1)); await.untilAsserted(() -> assertThat(search2.gauge().value()).isEqualTo(1)); }
@Scheduled(fixedRateString = "${l10n.management.metrics.quartz.sql-queue-monitoring.execution-rate}") public void reportPendingJobs() { Map<String, PendingJob> results = fetchResults(); updateQueueSizes(results); results.forEach(this::registerJobQueueSize); }
QuartzPendingJobsReportingTask { @Scheduled(fixedRateString = "${l10n.management.metrics.quartz.sql-queue-monitoring.execution-rate}") public void reportPendingJobs() { Map<String, PendingJob> results = fetchResults(); updateQueueSizes(results); results.forEach(this::registerJobQueueSize); } }
QuartzPendingJobsReportingTask { @Scheduled(fixedRateString = "${l10n.management.metrics.quartz.sql-queue-monitoring.execution-rate}") public void reportPendingJobs() { Map<String, PendingJob> results = fetchResults(); updateQueueSizes(results); results.forEach(this::registerJobQueueSize); } QuartzPendingJobsReportingTask(@Autowired DataSource dataSource,
                                          @Autowired MeterRegistry meterRegistry); }
QuartzPendingJobsReportingTask { @Scheduled(fixedRateString = "${l10n.management.metrics.quartz.sql-queue-monitoring.execution-rate}") public void reportPendingJobs() { Map<String, PendingJob> results = fetchResults(); updateQueueSizes(results); results.forEach(this::registerJobQueueSize); } QuartzPendingJobsReportingTask(@Autowired DataSource dataSource,
                                          @Autowired MeterRegistry meterRegistry); @Scheduled(fixedRateString = "${l10n.management.metrics.quartz.sql-queue-monitoring.execution-rate}") void reportPendingJobs(); }
QuartzPendingJobsReportingTask { @Scheduled(fixedRateString = "${l10n.management.metrics.quartz.sql-queue-monitoring.execution-rate}") public void reportPendingJobs() { Map<String, PendingJob> results = fetchResults(); updateQueueSizes(results); results.forEach(this::registerJobQueueSize); } QuartzPendingJobsReportingTask(@Autowired DataSource dataSource,
                                          @Autowired MeterRegistry meterRegistry); @Scheduled(fixedRateString = "${l10n.management.metrics.quartz.sql-queue-monitoring.execution-rate}") void reportPendingJobs();  }