Skip to content

Profiteur timing visualisation #3951

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

Merged
merged 17 commits into from
Jun 24, 2024
Merged

Profiteur timing visualisation #3951

merged 17 commits into from
Jun 24, 2024

Conversation

goodlyrottenapple
Copy link
Contributor

@goodlyrottenapple goodlyrottenapple commented Jun 20, 2024

This PR adds a small utility for turning JSON logs into timing profiles visualised via the https://github.com/jaspervdj/profiteur library

image

,
( "Timing"
,
[ [ctxt| request*,booster|kore>rewrite*,success|failure|abort|detail |]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In order to distinguish requests easily, I've added a new request <id> context. @geo2a @jberthold please let me know if this looks ok. If so, will update the docs and the other levelToContext mappings accordingly.

Copy link
Member

Choose a reason for hiding this comment

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

I see why you need this ... wanted to suggest adding the ID to the execute, simplify, implies, etc contexts that we already have instead, but that would be inferior and cause issues with the sub-requests we emit.
In the same change, we can also add a CtxStartup and CtxShutdown, Startup grouping the ceil-related messages which are currently info.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought we already have a [ceil] context?? do we want [startup][ceil]? what would be the advantage/difference?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i just noticed we no longer have the ceil context, @jberthold what was the reason for removing it?

Copy link
Member

Choose a reason for hiding this comment

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

As mentioned, the ceil had a double meaning, indicating a ceil rule (with ID) and indicating the ceil analysis phase (which could be included in said startup phase).
I was planning to amend that ceil issue in a follow-up but will wait for your change and what we decide.

,
( "Timing"
,
[ [ctxt| request*,booster|kore>rewrite*,success|failure|abort|detail |]
Copy link
Member

Choose a reason for hiding this comment

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

I see why you need this ... wanted to suggest adding the ID to the execute, simplify, implies, etc contexts that we already have instead, but that would be inferior and cause issues with the sub-requests we emit.
In the same change, we can also add a CtxStartup and CtxShutdown, Startup grouping the ceil-related messages which are currently info.

@@ -289,6 +290,15 @@ levelToContext =
[ [ctxt| booster>(simplification *|function *)>warning |]
]
)
,
( "Timing"
Copy link
Member

Choose a reason for hiding this comment

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

This flag could also include what is currently --print-stats (and should get its own context).

Copy link
Contributor Author

@goodlyrottenapple goodlyrottenapple Jun 21, 2024

Choose a reason for hiding this comment

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

I decided to remove --print-stats in favour of -l TimingStats as this is more uniform with how we invoke other logging options, but putting this filer in the -l Timing option would IMO be too verbose/unsuitable if we just want the stats but not the success/abort logging needed for the new timing tool

Copy link
Member

Choose a reason for hiding this comment

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

The code to parse --print-stats was just for backward compatibility. We can scrap it if that's not important.. (not sure who uses it except myself)

Copy link
Member

Choose a reason for hiding this comment

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

BTW run-with-tarball.sh uses --print-stats, maybe adjust that on the same PR

@goodlyrottenapple goodlyrottenapple marked this pull request as ready for review June 21, 2024 13:58
@goodlyrottenapple goodlyrottenapple requested a review from geo2a June 21, 2024 14:06
Copy link
Member

@jberthold jberthold left a comment

Choose a reason for hiding this comment

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

LGTM
We need to communicate the context changes to our power users...

@goodlyrottenapple goodlyrottenapple merged commit 47f2ac8 into master Jun 24, 2024
6 checks passed
@goodlyrottenapple goodlyrottenapple deleted the sam/profiteur-timing branch June 24, 2024 13:20
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.

2 participants