Skip to main content

Write and edit random files in a given directory

Project description

Monkeywork

Description

Are you in need of a Monkey typing on their keyboard and saving files into a random directory? Look no further…

This program was designed to stress test a file synchronization solution by simulating a user who reads, writes, and edits files within a specific directory. You can specify a working directory where the program will conduct the following operations at a set interval:

  • Create text and binary files with random content.
  • Create random subdirectories.
  • Open and edit files.
  • Rename files and directories.
  • Delete random files.
  • Delete random subdirectories. All operations are being written into a log file.

The idea behind this program is to run it on both ends of a file sharing or syncing solution. By doing so, you can test whether your solution is capable of handling regular and potentially conflicting user activities.

!!! CAUTION !!!

The program can and will destroy files in the selected work directory. Be sure to select a dedicated work directory and review the code before executing it on your system!

Run in console

You can run the monkeywork.py directly from from the console with:

python monkeywork.py "<Path to your workdir>" [OPTIONS]

example:

python monkeywork.py "L:\monkeywork-test\"

Options are:

-f | force selected direcotry and delete all contents in set directory -y | skip start confirmation

Installation

Use it as a package

pip install monkeywork

Usage

Example with custom interval setting:

from monkeywork import Monkey

mky = Monkey(workdir="F:/mky-test", interval_min_s=.1, interval_max_s=1)
mky.run()

orther avaiable setting:

variable Description
workdir:str must be set to a valid path
interval_min_s:float shortest interval
interval_max_s:float longest interval
max_file_size_mb:int maximum file size in MB
max_file_amount:int maximumg file count
target_file_amount:int program targets this amount of files
path_length_limit:int program should not exceed set path length
logging_to_file_enabled:bool enable logging to file

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

monkeywork-0.1.3.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

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

monkeywork-0.1.3-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file monkeywork-0.1.3.tar.gz.

File metadata

  • Download URL: monkeywork-0.1.3.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for monkeywork-0.1.3.tar.gz
Algorithm Hash digest
SHA256 ee05cae80ebea9e7d7500c443f07cae8e595b1dd343942e5cf9a627cf68d539c
MD5 ccb72543f81d3ee8739120503ae43d1e
BLAKE2b-256 898011f5ec14bd6c3fd8481dde17156c018d4f0badd881ca62a5ebe0f4ef39c7

See more details on using hashes here.

File details

Details for the file monkeywork-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: monkeywork-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for monkeywork-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 39e957b0f62b2ba7c0672051dea5d16dace7ca1b74459fd1a29abfae56c1a05c
MD5 2cb33204edfe1086e2b2067d7ac8d8db
BLAKE2b-256 2332ff6ac5ec19d5c8d07774c4021b0862bf224b95bf48b5e24619de3c7e167b

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