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 threshold config parameter for FactoryProf #294

Merged

Conversation

lHydra
Copy link
Contributor

@lHydra lHydra commented May 18, 2024

What is the purpose of this pull request?

Add threshold config parameter for FactoryProf to ignore factories which total number of calls is less than the provided threshold

Is there anything you'd like reviewers to focus on?

I'm not sure if support for this option is needed for flamegraph mode? As of now, I have only added support for simple mode

Checklist

  • I've added tests for this change
  • I've added a Changelog entry
  • I've updated a documentation

Closes #290

Copy link
Collaborator

@palkan palkan left a comment

Choose a reason for hiding this comment

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

Thanks!

Left a comment regarding the current logic. Let's fix it.

expect(output).to include("FactoryProf enabled (simple mode)")

expect(output).to include("Factories usage")
expect(output).to match(/Total: 16\n\s+Total top-level: 8\n\s+Total time: \d{2}+:\d{2}\.\d{3} \(out of \d{2}+:\d{2}\.\d{3}\)\n\s+Total uniq factories: 1/)
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should only hide less used factories from the output but totals still must show the actual data, i.e., here we should see "Total uniq factories: 2".

Thus, we need to update the exclusion logic (no select!, just skip when printing) and update the test to check that there is not match for skipped factories.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

docs/profilers/factory_prof.md Outdated Show resolved Hide resolved
@lHydra lHydra requested a review from palkan May 22, 2024 17:46
Copy link
Collaborator

@palkan palkan left a comment

Choose a reason for hiding this comment

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

Perfrect 👍 Thanks!

@palkan palkan merged commit 4ffe217 into test-prof:master May 22, 2024
17 checks passed
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.

Add threshold configuration to FactoryProf
2 participants