A package to simulate operations load.
Project description
Load Simulator
Overview
The Load Simulator is designed to simulate a variety of mathematical operations. It offers different levels of complexities and maintains an operation rate limiting feature.
Modules
constants.py
Contains constants and enumerations.
models.py
Defines data models for operation details, a list of operations, and simulator configuration.
operation_executor.py
Contains the OperationExecutor
class to execute mathematical operations.
utilities.py
Utility functions and context managers for logging and other functionalities.
load_simulator.py
Contains the LoadSimulator
class and run_simulator
function for simulating the load for mathematical operations.
Installation
-
Clone the repository
git clone https://github.com/yourkin/load-simulator.git
-
Navigate to the project directory
cd load_simulator
-
Install dependencies using Poetry
poetry install
-
Activate the virtual environment
poetry shell
Usage
The run_simulator
function can be imported to run the simulation:
from load_simulator.load_simulator import run_simulator
run_simulator(
seconds_to_run=10,
complexity="medium",
max_ops_per_sec=5
)
Parameters for run_simulator
seconds_to_run
: Number of seconds to run the simulation.complexity
: Complexity level for operations. Options are "easy", "medium", and "complicated".max_ops_per_sec
: Maximum number of operations per second.
Testing
Run the following command to execute the tests:
pytest
Contributing
Fork the repository and make changes as you'd like. Pull requests are warmly welcome.
License
Distributed under the MIT License. See LICENSE
for more information.
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
Hashes for load_simulator-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | daef637665698296f2b64eadc15d57e3ad89dc330933689e59ab136187913009 |
|
MD5 | 33e634ea44e2e37e0e3dde1264847356 |
|
BLAKE2b-256 | 21a98e2b42d5bba333321c3340d4557a08ed15124fcc1589f4ac97d11542f4a6 |