use of com.dangdang.ddframe.job.cloud.scheduler.config.job.CloudJobConfiguration 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.cloud.scheduler.config.job.CloudJobConfiguration in project elastic-job by dangdangdotcom.
the class JobContextTest method assertFrom.
@Test
public void assertFrom() {
CloudJobConfiguration jobConfig = CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job");
JobContext actual = JobContext.from(jobConfig, ExecutionType.READY);
assertThat(actual.getAssignedShardingItems().size(), is(10));
for (int i = 0; i < actual.getAssignedShardingItems().size(); i++) {
assertThat(actual.getAssignedShardingItems().get(i), is(i));
}
}
Aggregations