https://github.com/cgoldberg/pageloadtimer
Automated Page Load Timer (Web Navigation Timing)
https://github.com/cgoldberg/pageloadtimer
Last synced: about 2 months ago
JSON representation
Automated Page Load Timer (Web Navigation Timing)
- Host: GitHub
- URL: https://github.com/cgoldberg/pageloadtimer
- Owner: cgoldberg
- License: mit
- Created: 2015-01-09T22:08:08.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-12-15T15:25:38.000Z (almost 10 years ago)
- Last Synced: 2025-04-16T00:46:54.078Z (6 months ago)
- Language: Python
- Homepage:
- Size: 74.2 KB
- Stars: 13
- Watchers: 3
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE.txt
Awesome Lists containing this project
README
-------------
pageloadtimer
-------------**Automated Page Load Timer - Web Navigation Timing (PerformanceTiming Interface)**
- Author: Corey Goldberg, 2015
- License: MIT
- Development: `https://github.com/cgoldberg/pageloadtimer `_----
**About**:
**pageloadtimer** is a Python program for timing automated browser page loads. It uses Selenium WebDriver to drive a browser, and gathers metrics from the Navigation Timing API's `PerformanceTiming` Interface. This allows you to measure performance for different phases of loading a web page in a Browser.
----
**Requirements**:
- Python Version:
- Python 2.7+ or Python 3.3+
- System Dependencies:
- Firefox (web browser)
- Xvfb (virtual display server)- Python Requirements:
- selenium
- xvfbwrapper----
**Installation from GitHub repo**
1. install system requirements (Debian/Ubuntu)::
$ sudo apt-get install -y firefox git python-virtualenv xvfb
2. clone the pageloadtimer repo::
$ git clone https://github.com/cgoldberg/pageloadtimer.git
$ cd pageloadtimer3. create and activate a virtualenv::
$ virtualenv env
$ source env/bin/activate4. install pageloadtimer and requirements::
$ pip install -e .
----
**Usage**
- load a page and get timing info::
$ python pageloadtimer.py http://example.com
- load a page and get timing info, with the browser running headless (Xvfb).::
$ python pageloadtimer.py -x http://example.com
----
**Example**
::
$ python pageloadtimer.py -x www.example.com
starting browser.
loading page.
quitting browser.navigation event timings:
*************************
navigationStart: 0ms
fetchStart: 2ms
domainLookupStart: 2ms
domainLookupEnd: 2ms
connectStart: 2ms
connectEnd: 2ms
requestStart: 113ms
responseStart: 154ms
responseEnd: 155ms
domLoading: 154ms
domInteractive: 173ms
domContentLoadedEventStart: 173ms
domContentLoadedEventEnd: 173ms
domComplete: 181ms
loadEventStart: 181ms
loadEventEnd: 181ms----
**Further Reading**:
- Navigation Timing API: `W3C Recommendation `_
- Navigation Timing API: `Mozilla Developer Network `_
- Selenium WebDriver: `PyPI `_----
**Browser Processing Model**:
.. image:: timing-overview.png