Giter VIP home page Giter VIP logo

browsertime's Introduction

Browsertime - Your browser, your page, your scripts!

Build status Downloads Stars

Browsertime

Access the Web Performance Timeline, from your browser, in your terminal!

Browsertime allows you to:

  1. Query timing data directly from the browser, to access Navigation Timing, User Timing, Resource Timing, first paint and RUM Speed Index.
  2. Generate HAR files (using [HAR Export trigger] (https://github.com/firebug/har-export-trigger) for Firefox and parsing the Chrome log for Chrome).
  3. Run custom Javascript scripts in the browser and get statistics for each run.

A simple example

$ bin/browsertime.js https://www.sitespeed.io

Load https://www.sitespeed.io in Chrome three times. Results are stored in a json file (browsertime.json) with the timing data, and a har file (browsertime.har) in browsertime-results/www.sitespeed.io/$date/

I want more examples

Checkout the examples.

Browsers

Browsertime supports Firefox and Chrome on desktop. On Android we support Chrome. Yep that's it for now.

But we want to support Opera (on Android) sitespeedio#150 and when Safari 10 is available, we will add it too. And when(?!) iOS Safari supports WebDriver we will add that too.

How does it work

Browsertime uses Selenium NodeJS to drive the browser. It starts the browser, load a URL, executes configurable Javascripts to collect metrics, collect a HAR file.

To get the HAR from Firefox we use the HAR Export Trigger and Chrome we parse the timeline log and generates the HAR file.

Oh and you can run your own Selenium script before (--preScript) and after (--postScript) a URL is accessed so you can login/logout or do whatever you want.

Test using Docker

You can build and test changes using Docker locally. Using Docker is cool because we have ready made containers with Firefox/Chrome and all the dependencies needed for running VisualMetrics to get SpeedIndex.

$ docker build -t sitespeedio/browsertime .
$ docker run --privileged --shm-size=1g --rm -v "$(pwd)":/browsertime-results sitespeedio/browsertime -n 1 -c cable --video --speedIndex https://www.sitespeed.io/

The rewrite to 1.0

The master is to a large degree a re-write of the internal implementation, the cli interface, and the node API. It's based on learnings from the previous releases of Browsertime, and their use in Sitespeed.io. It's still lacking some features from the 0.x releases, and the API is not final. However it should be a better foundation for future development, using more modern Javascript features and a much more extensive test suite.

With 1.0 we dropped BrowsermobProxy so you don't need Java ๐Ÿ˜„ to run anymore and each run will be 1000% faster. Also we now support HTTP/2 and pre and post selenium scripts, if you want to do things before the URL is tested.

If you would would like to get started there are a few examples that can be found in the docs folder. If you run into any issues getting started using Browsertime visit our Issues Page for some common issues/solutions. If you still cannot resolve the problem and feel the issue is within browsertime feel free to open an issue.

browsertime's People

Contributors

soulgalore avatar tobli avatar beenanner avatar bitdeli-chef avatar okor avatar ryandoll avatar walterebert avatar moos avatar

Watchers

James Cloos avatar serina_gyt 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.