问题描述
我们有一个使用石英2.2.1的Java应用程序(ESB),我们使用它来计划数百个用户作业.
We have a Java application (ESB) that uses quartz 2.2.1 and we use it to schedule hundreds of user jobs.
我想在我们的应用程序中为我们的用户构建监视页面(或调度程序管理页面),以便他们可以查看石英调度程序是否运行正常或此组件中是否存在任何问题.
I want to build monitoring page (or scheduler administration page) in my application for our users so that they can see if quartz scheduler is running fine or there is any issue in this component.
石英是否为此目的提供任何监视API?谁能根据您的经验告诉我们应在此监视(或管理)页面中显示哪些数据点?我能想到的一些要点:
Does quartz provides any monitoring API for this purpose? Can anyone please tell us what all data points should we show in this monitoring (or administration) page based on your experience? Some of the points that I can think of:
- 计划程序状态(正在运行|已暂停|已关闭).
- 运行时显示上一个触发时间"和下一个触发时间"信息的作业数.
- 线程池的实现及其大小.
- JDBCJobStore配置详细信息.
是否可以显示有关触发失败的触发器的信息?我没有看到任何API可以向我提供有关触发错误的触发器的信息.谁能告诉我如何从调度程序中获取此信息?
Is there a way to show the information about triggers that were misfired? I don't see any API that provides me information about misfired triggers. Can anyone tell me how to get this information from scheduler?
在这方面的任何帮助都将受到赞赏.
Any help in this regard shall be appreciated.
推荐答案
您在此处命名了许多不同的问题
You named here many different issues
计划程序状态(1):
Scheduler sched =...
sched.isInStandbyMode();
sched.isStarted();
sched.isShutdown();
使用...运行的作业数(2),请参见此处
Number of jobs running with...(2) see here
Scheduler scheduler = new StdSchedulerFactory().getScheduler();
for (String groupName : scheduler.getJobGroupNames()) {
for (JobKey jobKey : scheduler.getJobKeys(GroupMatcher.jobGroupEquals(groupName))) {
String jobName = jobKey.getName();
String jobGroup = jobKey.getGroup();
//get job's trigger
List<Trigger> triggers = (List<Trigger>) scheduler.getTriggersOfJob(jobKey);
Date nextFireTime = triggers.get(0).getNextFireTime();
System.out.println("[jobName] : " + jobName + " [groupName] : "
+ jobGroup + " - " + nextFireTime);
}
}
线程池的实现及其大小.(3)
Thread pool implementation and its size.(3)
Scheduler sched =...
sched.getMetaData().getThreadPoolClass()
sched.getMetaData().getThreadPoolSize()
关于触发失败的触发器",您可以使用侦听器,特别是 TriggerListener.html#triggerMisfired 可能对您有所帮助.
Regarding "triggers that were misfired", you can use listeners, specifically TriggerListener.html#triggerMisfired may be helpful for you.
这篇关于Quartz Scheduler Administration页面:关于触发失败的信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!