feat: MonitorsController Chinese and English support #huacheng

This commit is contained in:
huacheng
2022-04-11 20:52:31 +08:00
parent 4f13875e01
commit 549362c843
8 changed files with 106 additions and 54 deletions

View File

@@ -15,6 +15,7 @@ import java.util.concurrent.TimeUnit;
/**
* 采集job管理提供api接口
*
* @author tomsun28
* @date 2021/11/6 13:58
*/
@@ -27,6 +28,7 @@ public class CollectJobService {
/**
* 执行一次性采集任务,获取采集数据响应
*
* @param job 采集任务详情
* @return 采集结果
*/
@@ -52,9 +54,11 @@ public class CollectJobService {
}
/**
* Issue periodic asynchronous collection tasks
* 下发周期性异步采集任务
* @param job 采集任务详情
* @return long 任务ID
*
* @param job Collect task details 采集任务详情
* @return long Job ID 任务ID
*/
public long addAsyncCollectJob(Job job) {
if (job.getId() == 0L) {
@@ -66,8 +70,10 @@ public class CollectJobService {
}
/**
* Update the periodic asynchronous collection tasks that have been delivered
* 更新已经下发的周期性异步采集任务
* @param modifyJob 采集任务详情
*
* @param modifyJob Collect task details 采集任务详情
*/
public void updateAsyncCollectJob(Job modifyJob) {
timerDispatch.deleteJob(modifyJob.getId(), true);
@@ -75,8 +81,10 @@ public class CollectJobService {
}
/**
* Cancel periodic asynchronous collection tasks
* 取消周期性异步采集任务
* @param jobId 任务ID
*
* @param jobId Job ID 任务ID
*/
public void cancelAsyncCollectJob(Long jobId) {
timerDispatch.deleteJob(jobId, true);

View File

@@ -10,36 +10,42 @@ import java.util.concurrent.TimeUnit;
/**
* 时间轮调度接口
*
* @author tomsun28
* @date 2021/10/17 22:14
*/
public interface TimerDispatch {
/**
* Add new job
* 增加新的job
* @param addJob job
* @param eventListener 一次性同步任务监听器异步任务不需要listener
*
* @param addJob job
* @param eventListener One-time synchronous task listener, asynchronous task does not need listener一次性同步任务监听器异步任务不需要listener
*/
void addJob(Job addJob, CollectResponseEventListener eventListener);
/**
* 调度循环周期性job
*
* @param timerTask timerTask
* @param interval 开始调度的间隔时间
* @param timeUnit 时间单位
* @param interval 开始调度的间隔时间
* @param timeUnit 时间单位
*/
void cyclicJob(WheelTimerTask timerTask, long interval, TimeUnit timeUnit);
/**
* 删除存在的job
* @param jobId jobId
*
* @param jobId jobId
* @param isCyclic 是否是周期性任务,true是, false为临时性任务
*/
void deleteJob(long jobId, boolean isCyclic);
/**
* 一次性同步采集任务采集结果通知监听器
* @param jobId jobId
*
* @param jobId jobId
* @param metricsDataTemps 采集结果数据
*/
void responseSyncJobData(long jobId, List<CollectRep.MetricsData> metricsDataTemps);