Skip to main content

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.

Update

The Load Simulator package is now available on PyPI. You can easily install it using pip:

pip install load-simulator==0.1.1

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

PyPI Method

  1. Install the package

    pip install load-simulator==0.1.1
    

Manual Method

  1. Clone the repository

    git clone https://github.com/yourkin/load-simulator.git
    
  2. Navigate to the project directory

    cd load_simulator
    
  3. Install dependencies using Poetry

    poetry install
    
  4. 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.

For commit messages, conform to Conventional Commits.


License

Distributed under the MIT License. See LICENSE for more information.


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

load_simulator-0.1.1.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

load_simulator-0.1.1-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file load_simulator-0.1.1.tar.gz.

File metadata

  • Download URL: load_simulator-0.1.1.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.6 Darwin/23.1.0

File hashes

Hashes for load_simulator-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9d49de4ecd6567ae48da8539db91cf6fb268907309a483591d8fc440daf3d4e9
MD5 2fa2eab8030b4279d96da39a310327b8
BLAKE2b-256 8a6f7d20243962ac741180273d89be90f1c0ddccf7f2ea59b4d01c9026caff07

See more details on using hashes here.

File details

Details for the file load_simulator-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: load_simulator-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.6 Darwin/23.1.0

File hashes

Hashes for load_simulator-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 73811ca286fe55ac0a43277f1553e474ed862a601eff8c6c4cb32d82d94f3ab3
MD5 b362bf08de82ee368dbe4f874eaab0f6
BLAKE2b-256 c74dfaf3c46eb9c70bb9b227954c6bee618259e747708985048c996152178c30

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page