-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
601 additions
and
4 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
...mmon/common-dao/src/main/java/io/holoinsight/server/common/dao/entity/AlarmCountable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. | ||
*/ | ||
package io.holoinsight.server.common.dao.entity; | ||
|
||
import lombok.Data; | ||
|
||
/** | ||
* 报警计数 | ||
* | ||
* @author limengyang | ||
* @version AlarmCountable.java, v 0.1 2024年09月19日 17:38 limengyang | ||
*/ | ||
@Data | ||
public class AlarmCountable { | ||
public Long customPluginId; | ||
public Long parentFolderId; | ||
public Long historyId; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...r/common/common-dao/src/main/java/io/holoinsight/server/common/dao/entity/FolderPath.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. | ||
*/ | ||
package io.holoinsight.server.common.dao.entity; | ||
|
||
import lombok.Data; | ||
|
||
import java.io.Serializable; | ||
|
||
/** | ||
* @author limengyang | ||
* @version FolderPath.java, v 0.1 2024年09月20日 11:14 limengyang | ||
*/ | ||
@Data | ||
public class FolderPath implements Serializable { | ||
private static final long serialVersionUID = -783815229535552853L; | ||
private Long id; | ||
private String name; | ||
private String type = FOLDER; | ||
|
||
public static final String FILE = "file"; | ||
public static final String FOLDER = "folder"; | ||
|
||
public FolderPath(Long id, String name) { | ||
super(); | ||
this.id = id; | ||
this.name = name; | ||
} | ||
|
||
public FolderPath(Long id, String name, String type) { | ||
super(); | ||
this.id = id; | ||
this.name = name; | ||
this.type = type; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
.../common/common-dao/src/main/java/io/holoinsight/server/common/dao/entity/FolderPaths.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. | ||
*/ | ||
package io.holoinsight.server.common.dao.entity; | ||
|
||
import lombok.Data; | ||
|
||
import java.io.Serializable; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* 文件夹路径 | ||
* | ||
* @author limengyang | ||
* @version FolderPaths.java, v 0.1 2024年09月20日 10:09 limengyang | ||
*/ | ||
@Data | ||
public class FolderPaths implements Serializable { | ||
private static final long serialVersionUID = 685496251839004159L; | ||
public List<FolderPath> paths = new ArrayList<FolderPath>(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...on-common-flyway/src/main/resources/db/migration/V34__240920_ADD_custom_plugin_COLUMN.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
ALTER TABLE `custom_plugin` | ||
ADD COLUMN `alarmed` TINYINT(4) NULL COMMENT '(归档)是否报警'; | ||
ALTER TABLE `custom_plugin` | ||
ADD COLUMN `recent_alarm_rule_unique_id` varchar(5000) DEFAULT NULL COMMENT '(归档)最近报警unique ID'; | ||
ALTER TABLE `custom_plugin` | ||
ADD COLUMN `recent_alarm` int(11) NULL COMMENT '(归档)最近报警数量'; | ||
ALTER TABLE `custom_plugin` | ||
ADD COLUMN `alarm_rrd_time` bigint(20) NULL COMMENT '归档时间'; |
4 changes: 4 additions & 0 deletions
4
...extension-common-flyway/src/main/resources/db/migration/V35__240920_ADD_folder_COLUMN.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ALTER TABLE `folder` ADD COLUMN `alarmed` tinyint(4) DEFAULT NULL COMMENT '(归档)是否报警'; | ||
ALTER TABLE `folder` ADD COLUMN `recent_alarm_rule_unique_id` varchar(5000) DEFAULT NULL COMMENT '(归档)最近报警unique ID'; | ||
ALTER TABLE `folder` ADD COLUMN `recent_alarm` int(11) DEFAULT NULL COMMENT '(归档)最近报警数量'; | ||
ALTER TABLE `folder` ADD COLUMN `alarm_rrd_time` bigint(20) DEFAULT NULL COMMENT '归档时间'; |
2 changes: 2 additions & 0 deletions
2
...ommon-flyway/src/main/resources/db/migration/V36__241011_ADD_folder_AND_custom_COLUMN.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ALTER TABLE `folder` ADD COLUMN `recent_alarm_history_id` varchar(5000) DEFAULT NULL COMMENT '(归档)最近报警历史ID'; | ||
ALTER TABLE `custom_plugin` ADD COLUMN `recent_alarm_history_id` varchar(5000) DEFAULT NULL COMMENT '(归档)最近报警历史ID'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
server/home/home-task/src/main/java/io/holoinsight/server/home/task/MonitorAlarmRrdTask.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* | ||
* Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. | ||
*/ | ||
package io.holoinsight.server.home.task; | ||
|
||
import io.holoinsight.server.common.model.CLUSTER_ROLE_CONST; | ||
import io.holoinsight.server.common.service.AlarmHistoryDetailService; | ||
import io.holoinsight.server.common.service.AlarmMetricService; | ||
import io.holoinsight.server.common.service.FolderService; | ||
import io.holoinsight.server.common.service.MetricInfoService; | ||
import io.holoinsight.server.home.biz.service.CustomPluginService; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Service; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* @author limengyang | ||
* @version MonitorAlarmRrdTask.java, v 0.1 2024年09月19日 15:41 limengyang | ||
*/ | ||
@Service | ||
@TaskHandler(code = "MONITOR_ALARM_RRD") | ||
public class MonitorAlarmRrdTask extends AbstractMonitorTask { | ||
|
||
public final static String TASK_ID = "MONITOR_ALARM_RRD"; | ||
|
||
public final static Long PERIOD = 5 * MINUTE; | ||
|
||
@Autowired | ||
private AlarmHistoryDetailService alarmHistoryDetailService; | ||
|
||
@Autowired | ||
private CustomPluginService customPluginService; | ||
|
||
@Autowired | ||
private FolderService folderService; | ||
|
||
@Autowired | ||
private MetricInfoService metricInfoService; | ||
|
||
@Autowired | ||
private AlarmMetricService alarmMetricService; | ||
|
||
|
||
public MonitorAlarmRrdTask() { | ||
super(1, 10, "MONITOR_ALARM_RRD"); | ||
} | ||
|
||
@Override | ||
public long getTaskPeriod() { | ||
return PERIOD; | ||
} | ||
|
||
@Override | ||
public boolean needRun() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public List<MonitorTaskJob> buildJobs(long period) { | ||
List<MonitorTaskJob> jobs = new ArrayList<>(); | ||
jobs.add(new MonitorAlarmRrdTaskJob(period, alarmHistoryDetailService, customPluginService, | ||
metricInfoService, alarmMetricService, folderService)); | ||
return jobs; | ||
} | ||
|
||
public String getRole() { | ||
// 代表执行本任务的具体Role | ||
return CLUSTER_ROLE_CONST.META; | ||
} | ||
|
||
} |
Oops, something went wrong.