[18.0][IMP] rest_log: add profiling#589
Draft
grindtildeath wants to merge 11 commits intoOCA:18.0from
Draft
Conversation
Contributor
|
Hi @simahawk, |
simahawk
reviewed
Feb 11, 2026
Contributor
simahawk
left a comment
There was a problem hiding this comment.
early review, to be tested.
simahawk
reviewed
Feb 11, 2026
Contributor
|
I've reworked it and simplified a bit. How it works:
UPDATED: 12/02 |
TDu
reviewed
Feb 11, 2026
| .get_param("rest.log.profiling.uid") | ||
| ) | ||
| except ValueError as err: | ||
| _logger.warning( |
Member
There was a problem hiding this comment.
If no valid uid is found, then profiling_uid is set to 0, which never matches self.env.uid.
Then nothing happens.
66f3662 to
524d239
Compare
This allows to use the same syntax than the existing one from rest.log.active to define other config parameters.
Leverage ir.profile machinery to track what happens when a user calls some rest services. Since profiling can be done only for a single user at a time the system parameter rest.log.profiling.uid has to be defined with the ID from res.users whose calls need to be profiled. Moreover, system parameter rest.log.profiling.conf can be defined using the syntax from rest.log.active to fine tune which requests will trigger the profiling for the user defined by the previous parameter. To note, once a request is identified to start the profiling, all incoming requests from the user will be profiled until the timeout duration defined by rest.log.profiling.duration is reached.
Gives better control on how to profile.
524d239 to
582e759
Compare
grindtildeath
commented
Feb 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[REF] rest_log: Add hooks to read configuration from system params
This allows to use the same syntax than the existing one from
rest.log.active to define other config parameters.
[IMP] rest_log: Allow to profile requests through rest services
Leverage ir.profile machinery to track what happens when a user
calls some rest services.
Since profiling can be done only for a single user at a time the
system parameter rest.log.profiling.uid has to be defined with
the ID from res.users whose calls need to be profiled.
Moreover, system parameter rest.log.profiling.conf can be defined
using the syntax from rest.log.active to fine tune which requests
will trigger the profiling for the user defined by the previous
parameter.
To note, once a request is identified to start the profiling, all
incoming requests from the user will be profiled until the timeout
duration defined by rest.log.profiling.duration is reached.