Skip to content

πŸ›°οΈ A lightweight, zero-config Python utility for monitoring API uptime and latency. Features automated JSON logging and simple status reporting.

Notifications You must be signed in to change notification settings

theomasfoolery/PulseRoute

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

PulseRoute πŸ›°οΈ

PulseRoute is a lightweight, zero-dependency (outside of requests) API health monitoring tool written in Python. It is designed for developers who need a simple, scriptable way to track the uptime and latency of multiple web services without the complexity of a full SaaS monitoring suite. PulseRoute Logo

🌟 Features

  • Real-time Monitoring: Measures HTTP response codes and latency in milliseconds.
  • Detailed Logging: Exports results to a structured health_log.json for easy parsing by other tools.
  • Robust Error Handling: Gracefully handles connection timeouts, DNS failures, and 400/500 level errors.
  • Lightweight: Minimal CPU and memory footprint.

πŸ“‚ Project Structure

pulseroute/
β”œβ”€β”€ .gitignore          # standard python ignore rules
β”œβ”€β”€ README.md           # project documentation
β”œβ”€β”€ requirements.txt    # external dependencies
β”œβ”€β”€ main.py             # script entry point & config
└── monitor.py          # core monitoring logic


πŸš€ Quick Start

1. Prerequisites

Ensure you have Python 3.8+ installed on your system.

2. Installation

Clone the repository and install the required dependencies:

# Clone the repository
git clone https://github.com/yourusername/pulseroute.git
cd pulseroute

# Install dependencies
pip install -r requirements.txt

3. Usage

Run the monitor using the default configuration:

python main.py

βš™οΈ Configuration

To monitor your own services, open main.py and update the TARGET_URLS list:

# main.py

TARGET_URLS = [
    "https://api.myapp.com/health",
    "https://db.service.io",
    "https://google.com"
]

Output Example

When executed, PulseRoute provides immediate console feedback and writes to a file:

Console:

--- PulseRoute: Starting Health Check ---
βœ… https://www.google.com - 42.15ms
βœ… https://www.github.com - 89.32ms
❌ https://httpbin.org/status/404 - 35.1ms

Results saved to health_log.json

JSON Log (health_log.json):

[
    {
        "url": "https://www.google.com",
        "status": 200,
        "latency_ms": 42.15,
        "timestamp": "2025-05-20T10:30:00.123456",
        "online": true
    }
]

🀝 Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create.

  1. Fork the Project.
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature).
  3. Commit your Changes (git commit -m 'Add some AmazingFeature').
  4. Push to the Branch (git push origin feature/AmazingFeature).
  5. Open a Pull Request.

πŸ“„ License

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

About

πŸ›°οΈ A lightweight, zero-config Python utility for monitoring API uptime and latency. Features automated JSON logging and simple status reporting.

Topics

Resources

Stars

Watchers

Forks

Languages