Skip to content

[18.0][IMP] rest_log: add profiling#589

Open
grindtildeath wants to merge 8 commits intoOCA:18.0from
camptocamp:18.0-imp-server_logs_and_profiling
Open

[18.0][IMP] rest_log: add profiling#589
grindtildeath wants to merge 8 commits intoOCA:18.0from
camptocamp:18.0-imp-server_logs_and_profiling

Conversation

@grindtildeath
Copy link
Copy Markdown
Contributor

@grindtildeath grindtildeath commented Feb 10, 2026

[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.

@OCA-git-bot
Copy link
Copy Markdown
Contributor

Hi @simahawk,
some modules you are maintaining are being modified, check this out!

Copy link
Copy Markdown
Contributor

@simahawk simahawk left a comment

Choose a reason for hiding this comment

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

early review, to be tested.

Comment thread rest_log/components/service.py Outdated
Comment thread rest_log/components/service.py Outdated
Comment thread rest_log/components/service.py Outdated
@simahawk
Copy link
Copy Markdown
Contributor

simahawk commented Feb 11, 2026

I've reworked it and simplified a bit. How it works:

  1. set rest.log.profiling.uid to enable the given user id(s) (CSV list of ids)
  2. set rest.log.profiling.conf to enable the conf for a specific app/collection (eg: shopfloor.app)

base.profiling_enabled_until is needed only to view the speedscope.

UPDATED: 12/02

Comment thread rest_log/components/service.py
@mmequignon mmequignon force-pushed the 18.0-imp-server_logs_and_profiling branch from 66f3662 to 524d239 Compare February 11, 2026 10:28
@simahawk simahawk force-pushed the 18.0-imp-server_logs_and_profiling branch from 524d239 to 582e759 Compare February 12, 2026 12:38
@simahawk simahawk changed the title [18.0][IMP] server logs and profiling [18.0][IMP] rest_log: add profiling Feb 12, 2026
Comment thread rest_log/components/service.py Outdated
grindtildeath and others added 8 commits May 5, 2026 16:42
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.
@simahawk simahawk force-pushed the 18.0-imp-server_logs_and_profiling branch from 179fdd3 to c3258c6 Compare May 5, 2026 14:47
@simahawk simahawk marked this pull request as ready for review May 5, 2026 14:47
@simahawk
Copy link
Copy Markdown
Contributor

simahawk commented May 5, 2026

using it live since a while: works fine :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants