Skip to content

Instantly share code, notes, and snippets.

View thomaspaulb's full-sized avatar

Tom thomaspaulb

View GitHub Profile
@thomaspaulb
thomaspaulb / test-rpc.py
Created January 21, 2024 21:45
test-rpc.py
from locust import HttpUser, task, between, events
import odoorpc
import logging
import time
import sys
```
With this locust file, you can benchmark rpc calls of Odoo, eg load_views, fields_view_get, search etc.
NOTE: There is another Gist for testing page loads (test-pageload.py)
@thomaspaulb
thomaspaulb / test-pageload.py
Created January 21, 2024 21:42
Odoo load testing with locust
from locust import HttpUser, task, between, events
import logging
import time
import sys
```
With this locust file, you can benchmark page loads of Odoo, eg /web, /my/orders, etc.
NOTE: There is another Gist for testing RPC calls (test-rpc.py)
HOW TO USE
#!/bin/bash
##################################################################################
## ##
## To run this script by command line in background issue this command ##
## ./monitoring-odoo-postgresql-lock > /dev/null 2>&1 & ##
## To kill this script if running issue this command ##
## pkill -f monitoring-odoo-postgresql-lock ##
## To add this script to crontab: ##
## @reboot /path/to/monitoring-odoo-postgresql-lock > /dev/null 2>&1 || true ##
## ##
@thomaspaulb
thomaspaulb / trigger.sql
Last active October 28, 2021 16:20
Test trigger for Odoo stock issues
CREATE OR REPLACE FUNCTION check_quants_equal_moves()
RETURNS TRIGGER AS
$BODY$
DECLARE
quants_amount int;
moves_from int;
moves_to int;
BEGIN
quants_amount := (
select sum(quantity) qty
@thomaspaulb
thomaspaulb / info_json.png
Last active May 27, 2021 08:37
How to restore Mendeley public folders
info_json.png