In Athento, this command allows you to generate a detailed report of the duration of queries that are running on the database, using the pgactivity tool. It is an effective way to identify which queries could be causing performance problems.
Options:
- emails: Specifies the emails to which the report will be sent, separated by commas. This allows the report to be sent to multiple recipients easily.
- In addition, you can use all the options available in the pgactivity command, these options allow you to further customize the filtering of the queries included in the report. https://django-pgactivity.readthedocs.io/en/1.7.1/command/#all-options
Example:
Imagine that you want to get a report on the slow queries (those that take more than 1 minute to execute) that are active at that moment. To do this, you can use the following command:
python manage.py queries_duration_report --emails ejemplo1@athento.com ejemplo2@athento.com -f 'duration__gt=1 minute' -f state=ACTIVE
In this example:
- The filter 'duration__gt=1 minute' selects queries that have a duration longer than 1 minute.
- The report will be sent to two email addresses: ejemplo1@athento.com and ejemplo2@athento.com.
This command is useful to have a precise control over slow queries and to be able to act proactively on possible performance problems.
Comments
0 comments
Please sign in to leave a comment.