forked from apache/eventmesh-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
0bed675
commit a38a7bd
Showing
50 changed files
with
2,685 additions
and
106 deletions.
There are no files selected for viewing
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
38 changes: 38 additions & 0 deletions
38
...he/eventmesh/dashboard/console/autoconfiguration/EventmeshDashboardAutoConfiguration.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,38 @@ | ||
///* | ||
// * Licensed to the Apache Software Foundation (ASF) under one or more | ||
// * contributor license agreements. See the NOTICE file distributed with | ||
// * this work for additional information regarding copyright ownership. | ||
// * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
// * (the "License"); you may not use this file except in compliance with | ||
// * the License. You may obtain a copy of the License at | ||
// * | ||
// * http://www.apache.org/licenses/LICENSE-2.0 | ||
// * | ||
// * Unless required by applicable law or agreed to in writing, software | ||
// * distributed under the License is distributed on an "AS IS" BASIS, | ||
// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// * See the License for the specific language governing permissions and | ||
// * limitations under the License. | ||
// */ | ||
// | ||
//package org.apache.eventmesh.dashboard.console.autoconfiguration; | ||
// | ||
//import org.apache.eventmesh.dashboard.console.funtion.health.HealthService; | ||
//import org.springframework.beans.factory.annotation.Autowired; | ||
//import org.springframework.boot.context.properties.EnableConfigurationProperties; | ||
//import org.springframework.context.annotation.Bean; | ||
//import org.springframework.context.annotation.Configuration; | ||
// | ||
//@Configuration | ||
//@EnableConfigurationProperties(EventmeshDashboardProperties.class) | ||
//public class EventmeshDashboardAutoConfiguration { | ||
// @Autowired | ||
// private EventmeshDashboardProperties eventmeshDashboardProperties; | ||
// | ||
// @Bean | ||
// public HealthService createHealthService() { | ||
// HealthService healthService = new HealthService(); | ||
// healthService.createHealthExecutor(eventmeshDashboardProperties.getHealthCheckConfig()); | ||
// return healthService; | ||
// } | ||
//} |
36 changes: 36 additions & 0 deletions
36
...rg/apache/eventmesh/dashboard/console/autoconfiguration/EventmeshDashboardProperties.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 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.eventmesh.dashboard.console.autoconfiguration; | ||
|
||
import org.apache.eventmesh.dashboard.console.config.HealthCheckConfig; | ||
|
||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import org.springframework.stereotype.Component; | ||
|
||
import lombok.Data; | ||
|
||
@Data | ||
@Component | ||
@ConfigurationProperties(prefix = "eventmesh") | ||
public class EventmeshDashboardProperties { | ||
|
||
/** | ||
* health check config | ||
*/ | ||
private HealthCheckConfig healthCheckConfig; | ||
} |
31 changes: 31 additions & 0 deletions
31
...onsole/src/main/java/org/apache/eventmesh/dashboard/console/config/HealthCheckConfig.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,31 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.eventmesh.dashboard.console.config; | ||
|
||
import org.apache.eventmesh.dashboard.console.function.health.HealthCheckObjectConfig; | ||
|
||
import java.util.List; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
public class HealthCheckConfig { | ||
private List<HealthCheckObjectConfig> checkObjectConfigList; | ||
} |
22 changes: 22 additions & 0 deletions
22
...sole/src/main/java/org/apache/eventmesh/dashboard/console/constant/ClientCallbackUrl.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 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.eventmesh.dashboard.console.constant; | ||
|
||
public class ClientCallbackUrl { | ||
public static final String HEALTH_CHECK_RUNTIME_CALLBACK = "/internal/health/runtime/callback"; | ||
} |
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
52 changes: 52 additions & 0 deletions
52
...in/java/org/apache/eventmesh/dashboard/console/entity/health/HealthCheckResultEntity.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,52 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.eventmesh.dashboard.console.entity.health; | ||
|
||
import org.apache.eventmesh.dashboard.console.entity.base.BaseEntity; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Schema(name = "HealthCheckResultEntity", description = "Health check result entity") | ||
public class HealthCheckResultEntity extends BaseEntity { | ||
|
||
private static final long serialVersionUID = -7350585209577598040L; | ||
@Schema(name = "id", description = "primary key") | ||
private Long id; | ||
|
||
private Long clusterId; | ||
|
||
@Schema(description = "Type of Health Check;0:Unknown, 1:Cluster, 2:Runtime, 3:Topic, 4:Storage", defaultValue = "0", allowableValues = {"0", | ||
"1", "2", "3", "4"}) | ||
private Integer type; | ||
|
||
@Schema(description = "Instance id(database schema) of the health check object") | ||
private Long typeId; | ||
|
||
private String resultDesc; | ||
|
||
@Schema(description = "status of a health check, 0: failed, 1: passed, 2: doing check, 3: out of time") | ||
private Integer status; | ||
|
||
} |
33 changes: 33 additions & 0 deletions
33
.../src/main/java/org/apache/eventmesh/dashboard/console/enums/health/HealthCheckStatus.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,33 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.eventmesh.dashboard.console.enums.health; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public enum HealthCheckStatus { | ||
FAILED(0, "failed"), | ||
PASSED(1, "passed"), | ||
CHECKING(2, "checking"), | ||
TIMEOUT(3, "timeout"); | ||
|
||
private final Integer number; | ||
private final String name; | ||
} |
58 changes: 58 additions & 0 deletions
58
...rc/main/java/org/apache/eventmesh/dashboard/console/enums/health/HealthCheckTypeEnum.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,58 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.eventmesh.dashboard.console.enums.health; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.Getter; | ||
|
||
@AllArgsConstructor | ||
public enum HealthCheckTypeEnum { | ||
UNKNOWN(0, "unknown"), | ||
|
||
CLUSTER(1, "cluster"), | ||
|
||
RUNTIME(2, "runtime"), | ||
|
||
TOPIC(3, "topic"), | ||
|
||
STORAGE(4, "storage"); | ||
|
||
@Getter | ||
private final Integer number; | ||
@Getter | ||
private final String name; | ||
|
||
public static Integer toNumber(String name) { | ||
for (HealthCheckTypeEnum healthCheckTypeEnum : HealthCheckTypeEnum.values()) { | ||
if (healthCheckTypeEnum.name.equals(name)) { | ||
return healthCheckTypeEnum.number; | ||
} | ||
} | ||
return UNKNOWN.number; | ||
} | ||
|
||
public static String toName(Integer number) { | ||
for (HealthCheckTypeEnum healthCheckTypeEnum : HealthCheckTypeEnum.values()) { | ||
if (healthCheckTypeEnum.number.equals(number)) { | ||
return healthCheckTypeEnum.name; | ||
} | ||
} | ||
return UNKNOWN.name; | ||
} | ||
} |
Oops, something went wrong.