phantomas

PhantomJS-based web performance metrics collector and monitoring tool

Github星跟蹤圖

phantomas npm Build Status Known Vulnerabilities

Headless Chromium-based modular web performance metrics collector. And why phantomas? Well, because :)

Requirements

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.writeor 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

Let's make Web a bit faster!

Slides

Blogosphere

Introductions to phantomas and use cases:

Videos

Utilities

Use grunt to automate daily dev tasks, including your's application web performance, via these great tools:

概覽

名稱與所有者macbre/phantomas
主編程語言JavaScript
編程語言JavaScript (語言數: 5)
平台
許可證BSD 2-Clause "Simplified" License
發布數58
最新版本名稱v2.11.0 (發布於 )
第一版名稱0.1 (發布於 2012-10-17 23:40:08)
創建於2012-07-07 16:28:54
推送於2024-04-26 05:14:12
最后一次提交
星數2.3k
關注者數66
派生數141
提交數3k
已啟用問題?
問題數446
打開的問題數58
拉請求數831
打開的拉請求數3
關閉的拉請求數75
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?
去到頂部