Skip to main content

A tool that measures the downtime from the user's perspective when restarting a web server and outputs it to a CSV file.

Project description

downtime-csv

This tool is used to measure how long a website is down from the user's perspective, such as when it is restarted. It continues to send HTTP requests for 5 minutes every 200ms, and outputs the start time, response time, and status of each request to standard output as CSV.

Requirements

Python >= 3.7

Install

You can download and install this tool from pypi with the command below.

pip install downtime-csv

Usage

You can collect data for that URL with the command below. The data is printed to standard output.

downtime-csv URL

Example

Using the command below, you can obtain the results of accessing google.com every 200ms for 5 minutes as test.csv. Load this into Excel and analyze it.

downtime-csv google.com > test.csv

The first column is the start time, but it has millisecond precision, so please set it to display milliseconds in Excel as well. Note that the output is in the order the requests finished. If you want to order by request start, sort the entire range by the value of the first column.

Add custom header

The downtim-csv command allows you to add headers to HTTP requests using the -H option, similar to curl.

downtime-csv https://example.com -H "Authorization: Bearer token" -H "Custom-Header: Value"

The headers given by default are as follows:

User-Agent: aiohttp/<version> python/<version>
Accept-Encoding: gzip, deflate
Accept: */*

These headers are what aiohttp adds to requests by default. If you add a custom header, it will not override these default headers, but if you specify a header with the same name, the custom header will take precedence.

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

downtime_csv-1.0.5.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

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

downtime_csv-1.0.5-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file downtime_csv-1.0.5.tar.gz.

File metadata

  • Download URL: downtime_csv-1.0.5.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.7 Linux/6.5.0-1025-azure

File hashes

Hashes for downtime_csv-1.0.5.tar.gz
Algorithm Hash digest
SHA256 e66c368af2ea3c05be45b5b61f2d821851fb3a2a3ee8c82fe06a7f246674425f
MD5 caa93d2388fbdd601abe793270c7a97b
BLAKE2b-256 d8c36153010ab010eaedbcdb135c52ed93c1a5569d04a709c18c8e15cf1e24bf

See more details on using hashes here.

File details

Details for the file downtime_csv-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: downtime_csv-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.7 Linux/6.5.0-1025-azure

File hashes

Hashes for downtime_csv-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 704913aac4c45317d1444782476e90c35a0ab778baa1ce0b040dd604a2302b71
MD5 9133d6281ff1c44b945996e635a20de0
BLAKE2b-256 f68bf87aaf2bfe831cbdbdfe10354bfd46f41320a263b64a9c0a21c3810d59dc

See more details on using hashes here.

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