• Stars
    star
    2,254
  • Rank 20,433 (Top 0.5 %)
  • Language
    JavaScript
  • License
    BSD 2-Clause "Sim...
  • Created over 12 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Headless Chromium-based web performance metrics collector and monitoring tool

phantomas npm Inline docs code style: prettier Coverage Status CodeFactor

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

Requirements

Installation

Via npm

latest

npm install phantomas

This will install a recent version of Chromium supported by puppeteer module.

Via Docker

You can use phantomas Docker image:

docker pull macbre/phantomas:latest

Or you can fetch from GitHub's Containers registry

docker pull ghcr.io/macbre/phantomas:latest

Support

Foo

You can get support for phantomas via xs:code.

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);
});

// including the custom one emitted by phantomas modules
promise.on('domQuery', (type, query) => {
        console.log('DOM query by %s - "%s"', type, query);
});

Or run ./examples/index.js.

Development version

To get the latest development version of phantomas (and install all required dependencies):

git clone [email protected]:macbre/phantomas.git
npm install

Running tests

First you need to start a local nginx container that will serve static assets used by integration tests suite. Then simply run npm t:

./test/server-start.sh
npm t

All pull requests that are filed for this repository will have tests run via GitHub Actions.

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 as an output format
  • 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.

You can also use it as a command line tool. Run phantomas -h for more details.

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:

Stargazers over time

Stargazers over time

More Repositories

1

sql-metadata

Uses tokenized query returned by python-sqlparse and generates query metadata
Python
809
star
2

analyze-css

CSS selectors complexity and performance analyzer
JavaScript
699
star
3

nodemw

MediaWiki API and WikiData client written in Node.js
JavaScript
237
star
4

index-digest

Analyses your database queries and schema and suggests indices and schema improvements
Python
76
star
5

docker-sphinxsearch

Docker image for Sphinx search engine
Dockerfile
54
star
6

push-to-ghcr

This action simplifies pushes of Docker images to ghcr.io repository and the Docker Hub
Dockerfile
26
star
7

mediawiki-dump

Python package for working with MediaWiki XML content dumps
Python
23
star
8

data-flow-graph

Uses your app logs to visualize how the data moves between the code, database, HTTP services, message queue, external storages etc.
Python
23
star
9

wayback-machine

Internet Wayback Machine nodejs Client
JavaScript
22
star
10

telemetry

Telemetry system based on 8-bit AVR microcontroller with full TCP/IP stack (DHCP, NTP, HTTP)
C
12
star
11

farerskie-kadry-feed

Turn Instagram and Facebook feeds into RSS
HTML
8
star
12

wiki-evolution

Visualize evolution of your MediaWiki based site
JavaScript
8
star
13

phantomas-python

Python module for easy integration with phantomas
Python
7
star
14

query-digest

A dynamic code analysis tool that processes SQL queries logs and data flow information
Python
7
star
15

mobify

Download a webpage as an e-book
Python
5
star
16

plc

Power Line Communication
C
4
star
17

travis-fold

Tiny module for emitting folding syntax for Travis CI output
JavaScript
3
star
18

3pc

3rd party web content database
Python
3
star
19

monolog-python

Python's logging formatter compatible with
Python
3
star
20

actions-index-digest

GitHub Actions for index-digest - database performance regression testing
3
star
21

phantomas-reporter-elasticsearch

elasticsearch reporter for phantomas
JavaScript
3
star
22

airrohr-prometheus-exporter

Make prometheus collect temperature, pressure and PM metrics from your airrohr station
Python
2
star
23

nordic-feed

RSS feeds agregator aka planet for Nordic blogs in Polish
Python
2
star
24

faroese-planet

RSS feeds agregator aka planet for Faroese blogs from around the world
Python
2
star
25

curl-http3

A custom curl build with BoringSSL and http3 support via quiche
Dockerfile
2
star
26

electronics

Various electronics related notes, projects and schematics
C
2
star
27

optimist-config-file

Extends optimist with support for JSON/YAML config file and Docker's inspired environment variables handling
JavaScript
1
star
28

map-porn

Templates used to generate maps based on geo data for Faroe Islands and Ireland
JavaScript
1
star
29

rs2eth

Ethernet / RS232 / RS485 converter with Telnet, VCOM and MCHP Discovery protocols support
1
star
30

faroese-resources

Faroese resources
HTML
1
star
31

pelican-planet

A fork of
Python
1
star
32

docker-traefik

Dockerized traefik v3 with auto-discovery of other containers on the same Docker network
Shell
1
star
33

elasticsearch-query

A fork of https://github.com/Wikia/python-commons/tree/master/wikia/common/kibana for public PyPI repository
Python
1
star
34

github-tools

GitHub toolbox
JavaScript
1
star
35

pyrabot

Skrypty bota używanego na Poznańskiej Wiki
Lua
1
star
36

fussball

IR-based goal system for football tables
C
1
star
37

slides

macbre's slides for Wikia
JavaScript
1
star
38

dlibra-py

Python interface for accessing dLibra-powered digital libraries using OAI-PMH protocol
1
star
39

test-wordpress-bitnami

The Docker Compose setup for the Bitnami-powered WordPress instance with SSH access and wp-cli installed. Can be easily put behind Traefik.
Shell
1
star