Skip to main content

Trace a HTTP request and gather the performance metrics.

Project description

tractus

License Github Workflow Python verions Format Implementation Version Quality

Trace HTTP requests and gather performance metrics.

Install

pip install tractus

Usage

from tractus import Tracer

result = Tracer('https://google.com').trace()

print(f'Host IP: {result.ip}')
print(f'Status code: {result.status_code}')
print(f'DNS time: {result.dns} ms')
print(f'Handshake time: {result.handshake} ms')
print(f'First byte time: {result.first_byte} ms')
print(f'Full body time: {result.full_data} ms')
print(f'Body length: {result.data_length} bytes')
print(f'Headers length: {result.headers_length} bytes')

Helpers:

# Get result as json
result.as_json()
# Get result as dict
result.as_dict()

License

MIT

Name

https://en.wiktionary.org/wiki/tractus

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

tractus-0.8.0.tar.gz (3.3 kB view hashes)

Uploaded source

Built Distribution

tractus-0.8.0-py3-none-any.whl (4.2 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page