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

Add Progress Bar in Profiling tools #456

Merged
merged 2 commits into from
Jul 26, 2023

Conversation

parthosa
Copy link
Collaborator

This PR fixes #278.
It introduces the progress bar for Profiling tools based on different modes of operation.

Progress Bar Update Design:

Depending on the mode parameter, the progress bar will now be updated as follows:

  1. Compare Mode:

    • Unknown: Each app that cannot be created or if number of created apps are less than 2
    • Failure: Any exception caught.
    • Success: All apps that can be processed successfully.
  2. Combined Mode:

    • Unknown: Each app that cannot be created.
    • Failure: Any exception caught.
    • Success: All apps that can be processed successfully.
  3. Collection Mode:

    • Unknown: Each app that cannot be created.
    • Failure: Any exception caught.
    • Success: All apps that can be processed successfully.

Changes to Current Design:

  • Previously, in compare mode and collection mode, the processApp() and writeOutput() functions were handled by the same try-catch block.
  • However, this structure made it difficult to differentiate if an exception was thrown by processApp or writeOutput.
  • To address this issue, a new method called writeSafelyToOutput is introduced to handle exceptions thrown during the writing process, ensuring that the progress bar excludes failures related to writing operations.

@parthosa parthosa added the core_tools Scope the core module (scala) label Jul 24, 2023
@parthosa parthosa self-assigned this Jul 24, 2023
def reportSuccessfulProcesses(n: Int): Unit = {
for(_ <- 1 to n) {
reportSuccessfulProcess()
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: You could use foreach instead of for here( It looks more of functional than imperative)

def reportSuccessfulProcesses(n: Int): Unit = {
  (1 to n).foreach(_ => reportSuccessfulProcess())
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

Signed-off-by: Partho Sarthi <[email protected]>
Copy link
Collaborator

@nartal1 nartal1 left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @parthosa !

@parthosa parthosa merged commit f757fc9 into NVIDIA:dev Jul 26, 2023
@parthosa parthosa deleted the spark-rapids-tools-278 branch July 26, 2023 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core_tools Scope the core module (scala)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEA] Profiling does not show progress
2 participants