Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature](ui) web profile download use plain text #34705

Closed
wants to merge 1 commit into from

Conversation

Mryange
Copy link
Contributor

@Mryange Mryange commented May 11, 2024

Proposed changes

download the plain text of the profile, reduce the overhead of string replace , converting JSON format.

    @RequestMapping(path = "/query_profile/{" + ID + "}", method = RequestMethod.GET)
    public Object profile(@PathVariable(value = ID) String id) {
        String profile = ProfileManager.getInstance().getProfile(id);
        if (profile == null) {
            return ResponseEntityBuilder.okWithCommonError("ID " + id + " does not exist");
        }
        profile = profile.replaceAll("\n", "</br>");
        profile = profile.replaceAll(" ", "&nbsp;&nbsp;");
        return ResponseEntityBuilder.ok(profile);
    }

Further comments

If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...

@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@Mryange
Copy link
Contributor Author

Mryange commented May 11, 2024

run buildall

@@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when this API will be used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

web use download

@Mryange Mryange closed this May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants