Skip to content

Commit

Permalink
[INLONG-10689][Manager] Support querying metric information (#10690)
Browse files Browse the repository at this point in the history
  • Loading branch information
fuweng11 authored Jul 23, 2024
1 parent 1afe87b commit 63df4f5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public interface AuditService {
*/
List<AuditVO> listAll(AuditRequest request) throws Exception;

List<AuditInformation> getAuditBases();
List<AuditInformation> getAuditBases(Boolean isMetric);

/**
* Get audit id by type and indicator type.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,13 @@ public Boolean refreshBaseItemCache() {
try {
auditIndicatorMap.clear();
List<AuditInformation> auditInformationList = AuditOperator.getInstance().getAllAuditInformation();
List<AuditInformation> metricInformationList = AuditOperator.getInstance().getAllMetricInformation();
auditInformationList.forEach(v -> {
auditItemMap.put(String.valueOf(v.getAuditId()), v.getNameInChinese());
});
metricInformationList.forEach(v -> {
auditItemMap.put(String.valueOf(v.getAuditId()), v.getNameInChinese());
});
} catch (Throwable t) {
LOGGER.error("failed to reload audit base item info", t);
return false;
Expand Down Expand Up @@ -226,9 +230,11 @@ public List<AuditVO> listAll(AuditRequest request) throws Exception {
}

@Override
public List<AuditInformation> getAuditBases() {
List<AuditInformation> auditInformations = AuditOperator.getInstance().getAllAuditInformation();
return auditInformations;
public List<AuditInformation> getAuditBases(Boolean isMetric) {
if (isMetric) {
return AuditOperator.getInstance().getAllMetricInformation();
}
return AuditOperator.getInstance().getAllAuditInformation();
}

private List<String> getAuditIds(String groupId, String streamId, String sourceNodeType, String sinkNodeType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ public Response<Boolean> refreshCache() {

@ApiOperation(value = "Get the audit base info")
@GetMapping("/audit/getAuditBases")
public Response<List<AuditInformation>> getAuditBases() {
return Response.success(auditService.getAuditBases());
public Response<List<AuditInformation>> getAuditBases(
@RequestParam(required = false, defaultValue = "false") boolean isMetric) {
return Response.success(auditService.getAuditBases(isMetric));
}

@GetMapping(value = "/audit/getAuditProxy")
Expand Down

0 comments on commit 63df4f5

Please sign in to comment.