diff --git a/fe/fe-core/src/main/java/org/apache/doris/httpv2/controller/QueryProfileController.java b/fe/fe-core/src/main/java/org/apache/doris/httpv2/controller/QueryProfileController.java index 2b6dd1fc4c46e7..767bad416883d1 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/httpv2/controller/QueryProfileController.java +++ b/fe/fe-core/src/main/java/org/apache/doris/httpv2/controller/QueryProfileController.java @@ -59,6 +59,15 @@ public Object profile(@PathVariable(value = ID) String id) { return ResponseEntityBuilder.ok(profile); } + @RequestMapping(path = "/query_profile/text/{" + ID + "}", method = RequestMethod.GET) + public Object text_profile(@PathVariable(value = ID) String id) { + String profile = ProfileManager.getInstance().getProfile(id); + if (profile == null) { + return ResponseEntityBuilder.okWithCommonError("ID " + id + " does not exist"); + } + return ResponseEntityBuilder.ok(profile); + } + @RequestMapping(path = "/query_profile", method = RequestMethod.GET) public Object query() { Map result = Maps.newHashMap(); diff --git a/ui/src/api/api.ts b/ui/src/api/api.ts index 184f1b65de47e0..f9e6d0c41a549c 100644 --- a/ui/src/api/api.ts +++ b/ui/src/api/api.ts @@ -69,9 +69,9 @@ export function getLog(data: any): Promise> { //query_profile export function queryProfile(data: any): Promise> { - let LocalUrl = '/rest/v1/query_profile/'; - if (data.path) { - LocalUrl = `/rest/v1/query_profile/${data.path}`; + let LocalUrl = '/rest/v1/query_profile'; + if (data.profile_id) { + LocalUrl = `/rest/v1/query_profile/text/${data.profile_id}`; } return request(LocalUrl, data); } diff --git a/ui/src/pages/query-profile/index.tsx b/ui/src/pages/query-profile/index.tsx index 2fefdcb43004d1..a06c21920b51f6 100644 --- a/ui/src/pages/query-profile/index.tsx +++ b/ui/src/pages/query-profile/index.tsx @@ -41,7 +41,7 @@ export default function QueryProfile(params: any) { const history = useHistory(); const doQueryProfile = function (ac?: AbortController) { const param = { - path: getLastPath(), + profile_id: getLastPath(), signal: ac?.signal, }; queryProfile(param) @@ -190,7 +190,9 @@ export default function QueryProfile(params: any) { {profile ? (
                     {/* {profile} */}