Skip to content

PatrickB-01/this-pc-api

Repository files navigation

ThisPc-API

python --version

ThisPc-Api is a Redis publisher, and an API endpoint used in ThisPc project, to deliver performance and system resources data about this pc.

Appendix

ThisPC-Project

ThisPC-Client: installed on the PC to monitor with.

Features

  • Collect: CPU, Memory, Network IO and Storage Disks stats.
  • API endpoint: Using FastAPI this pc becomes an API endpoint allowing remote entities to query the collected data about system resources, performance and running processes.
  • Interactive API documentation thanks to FastAPI automatic docs generation (OpenAPI).
  • Redis Publisher: This pc regularly publishes its collected data under a Redis channel PC- which enables subscribers to the PC-* pattern to get live data.

Installation

Clone this repository

  git clone https://github.com/Goldenboycoder/this-pc-api.git
  cd this-pc-api

Dependencies

pip install fastapi
pip install "uvicorn[standard]"
pip install "uvicorn[standard]" gunicorn
pip install redis

Usage

Depending on your environment you can use one of the following:

If running on Windows OS, use the ASGI server uvicorn which runs in a single process:

python deploy.py -m uvicorn

If running on Linux, then use gunicorn as a process manager in addition to uvicorn worker processes.

python deploy.py -m gunicorn

Interactive API docs

Open your browser to: 127.0.0.1:5555/docs

You will see the automatic interactive API documentation (provided by Swagger UI) The docs get automatically updated as you change the API.

Docs

Alternative API docs

Go to: 127.0.0.1:5555/redocs

You will see the alternative automatic documentation (provided by ReDoc)

Redoc

N.B: Port number may be different if you changed it.

License

BSD 3-Clause License

Author

twitter

linkedin

About

Api end-point used for monitoring system resources and performance

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors