Skip to main content

HTTP/HTTPS endpoint healthcheck.

Project description

Checking Health

CLI para execução de healthcheck em múltiplos endpoints HTTP/HTTPS, com saída rica, colorida e orientada a diagnóstico.


✨ Features

  • ✅ Execução sequencial com feedback em tempo real

  • 🌐 Suporte a múltiplos endpoints via arquivo

  • 🎯 Identificação do tipo de endpoint (TYPE) baseada na URL

  • 📊 Métricas detalhadas por requisição:

    • Status (OK / FAIL)
    • Código HTTP
    • Domain
    • IP
    • Content-Type
    • Tamanho do download
    • Tempo de resposta (REQ)
    • Tempo total (TIME)
    • Title (quando HTML)
  • 🎨 Saída colorida (verde/vermelho)

  • 📈 Resumo final com métricas agregadas

  • 🧪 Testável com pytest


📦 Instalação

Instale diretamente do PyPI:

pip install checking-health

🔗 Projeto no PyPI: https://pypi.org/project/checking-health


▶️ Uso

checking-health endpoints.txt --timeout 3

📄 Formato do arquivo de entrada

Arquivo .txt com uma URL por linha:

https://google.com/health
https://api.exemplo.com/status
api.interna.local/metrics

Regras:

  • Linhas vazias são ignoradas
  • Linhas iniciadas com # são ignoradas
  • URLs sem esquema recebem https:// automaticamente

📊 Exemplo de saída

TYPE         STATUS   HTTP   DOMAIN                IP              CONTENT-TYPE        SIZE     REQ(ms)  TIME(ms)  TITLE
---------------------------------------------------------------------------------------------------------------------------
healthcheck  OK       200    google.com.br         142.250.0.1     text/html           14.2KB        23        41  Google
status       OK       200    api.exemplo.com       10.0.0.1        application/json      512B        18        19  -
metrics      FAIL     -      api.interna.local     -               -                       0B        10        10  -

🧠 Conceitos importantes

TYPE

Último segmento da URL:

URL TYPE
/healthcheck healthcheck
/healthcheck/status status
/ root

REQ(ms)

Tempo até o servidor responder (latência).


TIME(ms)

Tempo total da requisição, incluindo download do conteúdo.


SIZE

Tamanho real baixado (body da resposta).


TITLE

Extraído do HTML (<title>), quando disponível.


📈 Resumo final

Resumo
------------------------------
Total        : 3
Success      : 2
Failure      : 1
REQ average  : 17ms
TIME average : 23ms

🧪 Testes

Instale pytest:

pip install pytest

Execute:

pytest -q

🔍 Casos de uso

  • Monitoramento rápido de APIs
  • Diagnóstico de latência
  • Verificação de ambientes (dev/sandbox/alpha/beta/prod)
  • Debug de problemas DNS / rede / conteúdo

⚠️ Limitações

  • Não separa tempo de DNS / TCP / TLS (tempo agregado)
  • Download completo do body pode impactar performance em respostas grandes
  • Execução sequencial (sem paralelismo)

🔮 Possíveis melhorias

  • Execução paralela (threads/async)
  • Retry automático
  • Exportação para CSV/JSON
  • Limite de download (--max-size)
  • Breakdown detalhado de latência (DNS, TLS, TTFB)
  • Agrupamento por TYPE

👤 Author

André Argôlo CTO • Software Architect • DevOps


📜 Licença

MIT License

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

checking_health-0.0.1.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

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

checking_health-0.0.1-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file checking_health-0.0.1.tar.gz.

File metadata

  • Download URL: checking_health-0.0.1.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for checking_health-0.0.1.tar.gz
Algorithm Hash digest
SHA256 85aa6c6f27cace37419ab82e223eb480827467ba557c208e15c8333c60830604
MD5 efb37d96a3117c6de5434078347ecc1b
BLAKE2b-256 6205461fdcd8f868b5c5c0b1acfa00929a68671ccb91e9d0bdfc30ca7b7c30c6

See more details on using hashes here.

Provenance

The following attestation bundles were made for checking_health-0.0.1.tar.gz:

Publisher: release.yml on argolo/checking-health

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file checking_health-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for checking_health-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7a14f1237df4f04e29777c49341ad175f6ee87bb3d20c0094e1905b134a75dbf
MD5 ec96c99b7ed6ad363fcc6703b727a00a
BLAKE2b-256 35aa13b8b7e2f3dfcc14329d38ff8c80cd1e15b96925f1c0c6ee4b27a2bea8a5

See more details on using hashes here.

Provenance

The following attestation bundles were made for checking_health-0.0.1-py3-none-any.whl:

Publisher: release.yml on argolo/checking-health

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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