npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

speedtrap

v0.0.2

Published

Tool for measuring performance of adaptivejs projects

Downloads

3

Readme

Tool for opening your adaptive project in a mobile web view and gathering it's metrics using browser-perf

Setup

1. Install Selenium

brew install selenium-server-standalone

2. Install ChromeDriver

Download the binary here: https://sites.google.com/a/chromium.org/chromedriver/downloads Move it to somewhere in your path so Selenium can find it (eg. /usr/bin)

3. Install the tool

git clone [email protected]:mobify/speedtrap.git
cd speedtrap
npm install
npm link

Usage

Browser Perf

Performs selenium tests on your project and logs out performance metrics.

  1. Run Selenium using selenium-server-standalone.
  2. Run grunt preview and copy the preview path URL to the tool.
  3. Run speedtrap:
speedtrap browser-perf --url "<preview-url>"

Perfjankie

This command can be used to log performance stats to a CouchDB dashboard. This can be useful to run on a per-commit basis to track performance over time. It is a wrapper for perfjankie (https://github.com/axemclion/perfjankie).

Run grunt preview and copy the preview path URL to the tool.

speedtrap perfjankie -u "<url>" -slug "<project-slug>" -n "<project-name>"

Notes:

  • The URL, project name and slug need to be surrounded by "" so that special characters aren't interpreted by bash
  • The "Site Url" needs to be complete (start with http:// or https://)
  • The SPEEDTRAP_DB_SERVER, SPEEDTRAP_DB_USERNAME and SPEEDTRAP_DB_PASSWORD environment variables need to be set in order for test data to be posted to the CloudDB site.

Troubleshooting:

  • If your dashboard breaks, your speedtrap may be linked to a version of perfjankie without the web files built. You will need to go into the linked perfjankie project and run grunt dist to generate the html/css/js for the dashboard. The site will then need to have the new files pushed to it (see perfjankie updateSite option).

Project Integration

Perfjankie was designed to be integrated into project CI environments to track performance over time.

Steps:
  1. Add environment variables for SPEEDTRAP_DB_SERVER, SPEEDTRAP_DB_USERNAME and SPEEDTRAP_DB_PASSWORD on CircleCI.
  2. Copy the scripts/speedtrap-ci.sh script to your project.
  3. Update the fields at the top of the script: SPEEDTRAP_URL, SPEEDTRAP_SLUG, and SPEEDTRAP_NAME.
  4. Call the speedtrap-ci.sh script in your circle.yml (recommended spot is with in the deployment section so tests can be run when merging to a specific branch vs. on every commit):
deployment:
    send_statistics:
        branch: [develop]
        commands:
            - <path_to_script>/speedtrap-ci.sh
            # OR
            # - <path_to_script>/speedtrap-ci.sh:
            #         pwd: <path_to_adaptive_project_root>
            # If your adaptive project isn't at the root of your repo

Development

Tests

grunt test

Linting

grunt lint

Code Coverage

grunt coverage

Report viewable through coverage/lcov-report/index.html