Python module for easy integration with phantomas
Project description
Python module for easy integration with phantomas - PhantomJS-based modular web performance metrics collector
Install
In order to use this module you need phantomas “binary” installed in your system.
sudo make install
This will run npm install -g phantomas.
Module’s API
import json from phantomas import Phantomas results = Phantomas( url="http://example.com", exec_path="/my/path/to/phantomas", # optional modules=['headers', 'requestsStats'] ).run() print('Generator: ' + results.get_generator()) # phantomas v1.9.0 print('\nMetrics: ' + json.dumps(results.get_metrics(), indent=True, sort_keys=True)) print('\nDomains: ' + json.dumps(results.get_offenders('domains'), indent=True)) # assertions assert results.get_metric('notFound') == 0 assert results.get_metric('requests') < 5
More docs coming soon! Meanwhile please refer to example/example.py script.
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
phantomas-0.2.3.tar.gz
(5.5 kB
view details)
File details
Details for the file phantomas-0.2.3.tar.gz
.
File metadata
- Download URL: phantomas-0.2.3.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2b0d384a1d5c24efc5bfb5846bad31323dcd61429865aee764c356bdab0b54a |
|
MD5 | 65574a9b61600af3ecb8262494e324e7 |
|
BLAKE2b-256 | a2d76ece18c02597cbeb33046f0e5973817d746afa4e87e01074d102e1978926 |