GithubHelp home page GithubHelp logo

scarsman / pageloadtimer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cgoldberg/pageloadtimer

0.0 2.0 0.0 90 KB

Automated Page Load Timer (Web Navigation Timing)

License: MIT License

Python 100.00%

pageloadtimer's Introduction

pageloadtimer

Automated Page Load Timer - Web Navigation Timing (PerformanceTiming Interface)


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 pageloadtimer
    
  3. create and activate a virtualenv:

    $ virtualenv env
    $ source env/bin/activate
    
  4. 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:


Browser Processing Model:

timing-overview.png

pageloadtimer's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.