Skip to content

Formartha/sleep-detector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cover

A CLI tool that scans your source code project for calls to sleep(...), aimed to find hidden bottlenecks.

Installation

pip install sleep-detector

Usage

sleep-detector /path/to/your/codebase --config sleep_detector.toml

Configuration

You must supply a configuration file to specify:

  • Which directories to exclude
  • Which file extensions to scan
  • What regex pattern to match

Example: sleep_detector.toml

excluded_dirs = ["venv", ".git", "build", "__pycache__"]
file_extensions = [".py"]
sleep_pattern = "\\b(?:time\\.)?sleep\\s*\\(\\s*(\\d+(?:\\.\\d+)?)\\s*\\)"

Run the tool:

sleep-detector . --config sleep_detector.toml

About

A small utility aim to help finding static sleep in a project

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages