use of com.dangdang.ddframe.job.statistics.type.job.JobExecutionTypeStatistics in project elastic-job by dangdangdotcom.
the class StatisticManager method getJobExecutionTypeStatistics.
/**
* 获取作业执行类型统计数据.
*
* @return 作业执行类型统计数据对象
*/
public JobExecutionTypeStatistics getJobExecutionTypeStatistics() {
int transientJobCnt = 0;
int daemonJobCnt = 0;
for (CloudJobConfiguration each : configurationService.loadAll()) {
if (CloudJobExecutionType.TRANSIENT.equals(each.getJobExecutionType())) {
transientJobCnt++;
} else if (CloudJobExecutionType.DAEMON.equals(each.getJobExecutionType())) {
daemonJobCnt++;
}
}
return new JobExecutionTypeStatistics(transientJobCnt, daemonJobCnt);
}
use of com.dangdang.ddframe.job.statistics.type.job.JobExecutionTypeStatistics in project elastic-job by dangdangdotcom.
the class CloudJobRestfulApiTest method assertGetJobExecutionTypeStatistics.
@Test
public void assertGetJobExecutionTypeStatistics() throws Exception {
String result = sentGetRequest("http://127.0.0.1:19000/job/statistics/jobs/executionType");
JobExecutionTypeStatistics jobExecutionTypeStatistics = GsonFactory.getGson().fromJson(result, JobExecutionTypeStatistics.class);
assertThat(jobExecutionTypeStatistics.getDaemonJobCount(), is(0));
assertThat(jobExecutionTypeStatistics.getTransientJobCount(), is(0));
}
Aggregations