phantomas

Headless Chromium-based modular web performance metrics collector. And why phantomas? Well, because :)
Requirements
- NodeJS 8+
Installation
npm install phantomas
This will install a recent version of Chromium supported by
puppeteer
module.
Usage example
const phantomas = require('phantomas'),
promise = phantomas('http://example.com/');
promise.
then(results => {
console.log('Metrics', results.getMetrics());
console.log('Offenders', results.getAllOffenders());
}).
catch(res => {
console.error(res);
});
// events handling
promise.on('recv', response => {
console.log('Response: %s %s [%s]', response.method, response.url, response.contentType);
});
Development version
To get the latest development version of phantomas (and install all required dependencies):
git clone git@github.com:macbre/phantomas.git
npm install
Having problems?
Please refer to /Troubleshooting.md
Features
- modular approach - each metric is generated by a separate "module"
- phantomas "core" acts as an events emitter that each module can hook into
- in-depth metrics such as: number of events bound via jQuery, calls to
window.write
or complex and duplicated CSS selectors (via analyze-css) - JSON and CSV as available output formats for easy integration with automated reporting / monitoring tools
- easy integration with Continuous Integration tools via TAP format and assertions handling
- metrics can be sent via StatsD or stored in elasticsearch
- easy integration with other nodejs projects via CommonJS module (see API docs)
- metrics can be emitted from JavaScript code of the page phantomas is run against (thanks to helper functions available in window.__phantomas)
- device profiles allow phantomas to emulate mobile or tablet (by setting a proper user agent and viewport)
Contributors
All the contributors
Usage
phantomas comes as a CommonJS module (see API docs) that you can use in your nodejs projects.
Metrics
Please refer to
/docs/metrics.md
file for a full, up-to-date list of all available modules and metrics that phantomas emits.
For developers
- Project's wiki
- Description of events fired by phantomas core
- Description of helper functions available to the browser in window.__phantomas
Let's make Web a bit faster!
- Best Practices for Speeding Up Your Web Site (by Yahoo!)
- Web Performance Best Practices (by Google)
- Writing Efficient CSS (by Mozilla)
- Planet Performance - news and views from the web performance blogosphere
- Performance of 3rd Party Content (by Steve Souders)
- Profiling CSS for fun and profit. Optimization notes.
Slides
- Know Your Engines: How to Make Your JavaScript Fast (by David Mandelin from Mozilla)
- Velocity Conf 2013 Workshop: Avoiding Web Performance Regression (by Marcel Duran from Twitter)
Blogosphere
Introductions to phantomas and use cases:
- phantomas – PhantomJS based, modular web performance metrics generator (an article for Performance Calendar)
- How to Measure Frontend Performance With Grunt
- MaxCDN Blog - Behind The Scenes: tools.maxcdn.com
- Measuring frontend performance
- Performance Budgets with Phantomas and Jenkins
- phantomas introduced at npmawesome.com
- Grunt.js for the Enterprise - Vol.1: Frontend Performance with Phantomas (by David Amend)
- Automated Frontend Testing at DrupalCon Austin 2014 (+video)
- Phantomas: Fais-moi un strip ! (in French)
Videos
Utilities
Use grunt to automate daily dev tasks, including your's application web performance, via these great tools: