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

Fix profile screen #1707

Merged
merged 1 commit into from
Mar 18, 2022
Merged

Fix profile screen #1707

merged 1 commit into from
Mar 18, 2022

Conversation

Alevsk
Copy link
Contributor

@Alevsk Alevsk commented Mar 12, 2022

Profiling endpoint fixes

  • Added support to download all profile tests
  • profile.zip file was corrupted after download

Signed-off-by: Lenin Alevski alevsk.8772@gmail.com

@Alevsk Alevsk added the needed High Priority label Mar 12, 2022
@Alevsk Alevsk self-assigned this Mar 12, 2022
@Alevsk Alevsk force-pushed the fix-profile branch 2 times, most recently from 9b04c51 to 05655a9 Compare March 12, 2022 00:46
@dvaldivia
Copy link
Collaborator

I think @kaankabalak was also working on this :S

dvaldivia
dvaldivia previously approved these changes Mar 12, 2022
@kaankabalak
Copy link
Contributor

kaankabalak commented Mar 12, 2022

I think @kaankabalak was also working on this :S

Yes @dvaldivia, there was a problem with the ZIP file being corrupted for the Stop Profiling endpoint, so I sent my work over to @Alevsk and he fixed the corruption issue and sent the PR 👍

@kaankabalak
Copy link
Contributor

@Alevsk, when I download the ZIP file when the type is selected as cpu or mem and unzip it, I see that a .pprof file appears briefly and then it disappears, resulting in a file with a name profile-127.0.0.1/9000-cpu without any extension. I think this might be an unexpected behavior as the download we have for the type selected as all includes this file with a .pprof extension.

Please refer to the video for further detail:

Screen.Recording.2022-03-11.at.5.26.22.PM.mov

And this is the content of the ZIP file when type is selected as all:

Screen Shot 2022-03-11 at 5 29 48 PM

@Alevsk
Copy link
Contributor Author

Alevsk commented Mar 12, 2022

I think this in a operating system behavior, we are streaming directly what minio is returning to us, I'll check on my Linux box tonight

@prakashsvmx
Copy link
Member

@kaankabalak
mc support profile start local --type cpu,mem - this could not be run via ui as the ui allows only one option or all options.

so the type can be one are more or all. so we can have a ui similar to trace

Current

image

Suggested types to be like (multi select)

image

@oscarocastellanos @dvaldivia please provide your feedback.

@oscarocastellanos
Copy link

@prakashsvmx @dvaldivia This is a good option, I think this is the best thing we can do.

@kaankabalak
Copy link
Contributor

@kaankabalak mc support profile start local --type cpu,mem - this could not be run via ui as the ui allows only one option or all options.

so the type can be one are more or all. so we can have a ui similar to trace

Current

image

Suggested types to be like (multi select)

image

@oscarocastellanos @dvaldivia please provide your feedback.

Yes, I also think that this is a good idea, I'll work on this 👍

@dvaldivia
Copy link
Collaborator

We also need to make this stateful at UI level, so that the user can navigate away from the profile screen and come back and still get the download, right now if you navigate apart and come back, it shows you to start the profiling again

@kaankabalak
Copy link
Contributor

We also need to make this stateful at UI level, so that the user can navigate away from the profile screen and come back and still get the download, right now if you navigate apart and come back, it shows you to start the profiling again

Hi @dvaldivia, as far as I can see, there is no API at the moment to check if Profiling is currently going on. We only seem to have the /start and /stop endpoints for Profiling. To implement this functionality, we would need an API that checks if a Profiling is currently going on, right? Thanks in advance for the help 👍

@dvaldivia
Copy link
Collaborator

@kaankabalak to keep it stateful we would need to start a websocket and keep it open in the back, this can tell the frontend we are running a profile at the moment, alternatively we can add the status API on MinIO, which I think makes sense since starting a profile and forgetting about it could degrade service cc @harshavardhana

@kaankabalak
Copy link
Contributor

@kaankabalak mc support profile start local --type cpu,mem - this could not be run via ui as the ui allows only one option or all options.

so the type can be one are more or all. so we can have a ui similar to trace

Hi @prakashsvmx, I have just applied this change. The screen now looks as follows:

Screen Shot 2022-03-14 at 6 28 50 PM

However, for the type argument in the profiling/start endpoint on our API currently supports either only a single value (i.e., {type: "cpu"}) or all the values (i.e., {type: "cpu,mem,block,mutex,trace,threads,goroutines"}).

Therefore, a combination of arguments like what @prakashsvmx has specified is not possible (for example, {type: "cpu,mem"} currently returns a status code of 422). @Alevsk, could you please advise on how we can fix this? Thanks in advance!

@Alevsk
Copy link
Contributor Author

Alevsk commented Mar 16, 2022

@kaankabalak mc support profile start local --type cpu,mem - this could not be run via ui as the ui allows only one option or all options.
so the type can be one are more or all. so we can have a ui similar to trace

Hi @prakashsvmx, I have just applied this change. The screen now looks as follows:

Screen Shot 2022-03-14 at 6 28 50 PM

However, for the type argument in the profiling/start endpoint on our API currently supports either only a single value (i.e., {type: "cpu"}) or all the values (i.e., {type: "cpu,mem,block,mutex,trace,threads,goroutines"}).

Therefore, a combination of arguments like what @prakashsvmx has specified is not possible (for example, {type: "cpu,mem"} currently returns a status code of 422). @Alevsk, could you please advise on how we can fix this? Thanks in advance!

Let's remove that limitation, to do that on swagger-console.yml locate profilingStartRequest and change the property type from $ref: "#/definitions/profilerType" to just type: string, that way the user can send any value he wants (if the user sends a wrong value minio will throw an error and the profiling won't start which is good).

After making that change you need to run make swagger-gen to re-generate the swagger code

@Alevsk Alevsk requested a review from dvaldivia March 16, 2022 01:01
@Alevsk Alevsk changed the title [WIP] Fix profile screen Fix profile screen Mar 16, 2022
dvaldivia
dvaldivia previously approved these changes Mar 16, 2022
@kaankabalak
Copy link
Contributor

However, for the type argument in the profiling/start endpoint on our API currently supports either only a single value (i.e., {type: "cpu"}) or all the values (i.e., {type: "cpu,mem,block,mutex,trace,threads,goroutines"}).

Therefore, a combination of arguments like what @prakashsvmx has specified is not possible (for example, {type: "cpu,mem"} currently returns a status code of 422). @Alevsk, could you please advise on how we can fix this? Thanks in advance!

Thanks @Alevsk, it works now 👍

@prakashsvmx
Copy link
Member

@kaankabalak is the diagnostics expected to complete in certain minutes/seconds. ?

New Diagnostic button exists after Diagnostic is completed
this permission test fails sporadically most of the time. locally i could not replicate it.

@kaankabalak
Copy link
Contributor

kaankabalak commented Mar 17, 2022

@kaankabalak is the diagnostics expected to complete in certain minutes/seconds. ?

New Diagnostic button exists after Diagnostic is completed this permission test fails sporadically most of the time. locally i could not replicate it.

No @prakashsvmx, we don't have any kind of restriction. This only happens on GitHub Actions and I am still investigating this. We saw that the test failed on headless mode for Node version 17, both locally and on GitHub Actions; so we reverted back to Node version 16, yet the failure still happens randomly.

kaankabalak
kaankabalak previously approved these changes Mar 18, 2022
Copy link
Contributor

@kaankabalak kaankabalak left a comment

Choose a reason for hiding this comment

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

We will be adding the WebSockets functionality on a separate PR 👍

- Added support to download all profile tests
- profile.zip file was corrupted after download
- Add suspension warning
- Add Checkbox support
- Support for running multiple profiling types at the same time
- fix profiling test

Signed-off-by: Lenin Alevski <alevsk.8772@gmail.com>
@bexsoft bexsoft merged commit d7fef8d into minio:master Mar 18, 2022
@Alevsk Alevsk deleted the fix-profile branch March 18, 2022 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needed High Priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants