Skip to content

Tools to diagnose Python projects (supervision, monitoring).

License

Notifications You must be signed in to change notification settings

python-hospital/hospital

Folders and files

NameName
Last commit message
Last commit date

Latest commit

4a34dec · Nov 19, 2014
Nov 18, 2014
Feb 6, 2014
Nov 19, 2014
Nov 19, 2014
Dec 26, 2013
May 2, 2014
Oct 28, 2014
Nov 19, 2014
Nov 18, 2014
Feb 28, 2014
Feb 28, 2014
Feb 6, 2014
Apr 30, 2014
Oct 28, 2014
Nov 19, 2014
May 2, 2014
Oct 28, 2014

Repository files navigation

hospital: healthchecks for Python

hospital is a Python framework to write health checks, smoke tests or diagnoses around applications or services.

Abstract

Health checks are kind of tests, applied to running applications and services:

  • write healtchecks just as you would write tests, using assertions;
  • collect and run healthchecks with test runners;
  • use healthchecks to validate deployments;
  • plug healthchecks in supervision and monitoring tools;
  • in case of incidents, use healthchecks to diagnose problems.

Example

In your project's root package, have a healthchecks package or module, where you assert your (running) application or service is ok:

import unittest
import hospital

@hospital.healthcheck
class DocumentationHealthCheck(unittest.TestCase):
    def test_http_200(self):
        url = 'http://hospital.readthedocs.org/en/0.6/'
        hospital.assert_http_response(url, status_code=200)

Then you can collect and run the healthchecks with command line or web service. Here is an example with command line:

$ hospital-cli <YOUR-PACKAGE>.healthchecks

Project status

hospital is not full-featured yet. Some important features are in the roadmap. See also vision.

Of course, any ideas, feedback or help are welcome :)

Resources