Minimal Locust users for Odoo XML-RPC and JSON-RPC
Project description
odoom
Locust user classes for load testing Odoo via RPC.
Installation
pip install odoom
Or directly from the GitHub repository:
pip install git+https://github.com/apikcloud/odoom.git
Concepts
- Each Locust user picks a random dataset from the pool at startup. With one dataset, all users share it; with multiple, each user draws one independently.
- A dataset is a directory containing one JSON file per task. Each file holds a list of rows (list of lists).
- Tasks are executed in order using
@sequential_task(n). By default a user stops when all tasks complete; setloop = Trueto repeat indefinitely.
Dataset structure
datasets/
set_001/
product_templates.json # [[val, ...], ...]
supplierinfos.json
set_002/
product_templates.json
supplierinfos.json
Writing a locustfile
from odoom.locust import OdooJsonRpcUser, sequential_task
class CatalogUser(OdooJsonRpcUser):
dataset_root = "./datasets"
loop = False # set True to repeat after all tasks complete
@sequential_task(1)
def import_templates(self):
rows = self.dataset.rows_for("product_templates")
self.odoo.load(
model="product.template",
fields=["id", "name", "default_code", "list_price"],
rows=rows,
)
@sequential_task(2)
def import_suppliers(self):
rows = self.dataset.rows_for("supplierinfos")
self.odoo.load(
model="product.supplierinfo",
fields=["id", "partner_id/id", "product_tmpl_id/id", "price"],
rows=rows,
)
Configuration
Options can be set via CLI, environment variable, or locust.conf:
| CLI flag | Env var |
|---|---|
--odoo-url |
LOCUST_ODOO_URL |
--odoo-db |
LOCUST_ODOO_DB |
--odoo-username |
LOCUST_ODOO_USERNAME |
--odoo-password |
LOCUST_ODOO_PASSWORD |
--odoo-dataset-root |
LOCUST_ODOO_DATASET_ROOT |
--odoo-timeout |
LOCUST_ODOO_TIMEOUT |
Example locust.conf:
odoo-url=https://odoo.example.com
odoo-db=mydb
odoo-username=admin
odoo-password=admin
odoo-dataset-root=./datasets
Running
One-shot (each user processes its dataset once, then stops):
locust --headless -u 4 -r 4 -f locustfile.py CatalogUser
Looping / soak test (set loop = True in your user class):
locust --headless -u 4 -r 4 --run-time 30m -f locustfile.py CatalogUser
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file odoom-0.1.1.tar.gz.
File metadata
- Download URL: odoom-0.1.1.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
efa3adbf00903477026ea428c3ff1117c698865a7dbe2c2b309b220e67aa538a
|
|
| MD5 |
e2de6c77f5bfd63df5e8df068f6ebe6e
|
|
| BLAKE2b-256 |
c353b4b8823e29470379248fe72c5f166307baa7717482651c5bb20ed6564e12
|
Provenance
The following attestation bundles were made for odoom-0.1.1.tar.gz:
Publisher:
publish.yml on apikcloud/odoom
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
odoom-0.1.1.tar.gz -
Subject digest:
efa3adbf00903477026ea428c3ff1117c698865a7dbe2c2b309b220e67aa538a - Sigstore transparency entry: 1195277907
- Sigstore integration time:
-
Permalink:
apikcloud/odoom@675596ee31bb5075af7d2050223b3d550682027f -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/apikcloud
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@675596ee31bb5075af7d2050223b3d550682027f -
Trigger Event:
push
-
Statement type:
File details
Details for the file odoom-0.1.1-py3-none-any.whl.
File metadata
- Download URL: odoom-0.1.1-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5abbd4d71764ddc30b5c61b99a782477ca446a9100b23119edad1ad8b9b531d
|
|
| MD5 |
23ecef78d5534fa0c0443cd6ef151440
|
|
| BLAKE2b-256 |
846aae4c7b0926b6a7696864b873666acbe2cd138f14a04c5310c3618477d984
|
Provenance
The following attestation bundles were made for odoom-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on apikcloud/odoom
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
odoom-0.1.1-py3-none-any.whl -
Subject digest:
a5abbd4d71764ddc30b5c61b99a782477ca446a9100b23119edad1ad8b9b531d - Sigstore transparency entry: 1195277928
- Sigstore integration time:
-
Permalink:
apikcloud/odoom@675596ee31bb5075af7d2050223b3d550682027f -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/apikcloud
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@675596ee31bb5075af7d2050223b3d550682027f -
Trigger Event:
push
-
Statement type: