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

holodeck

v0.1.2

Published

Play back a common log format log file, carrying out the same GET and HEAD requests with the same timing

Downloads

3

Readme

holodeck

Bombard your webserver with the same requests found in an existing common log format (CLF) log file, such as an Apache or Nginx log file. The requests are delivered in the same order, with the same timing. Think of it as a holodeck simulation for websites. Ideally, they can't tell the difference.

Install

npm install -g holodeck

Usage

holodeck http://mysite.example.com /path/to/access.log

That will hit the site mysite.example.com with the requests that are logged in the existing server log file /path/to/access.log.

Options

If your log file is from an extremely active site, you may need to send more than 200 simultaneous requests to accurately simulate it. --max-sockets=500 will let you send up to 500 requests at a time, rather than the default of 200.

You may want to skip sending requests for certain file extensions. Use --ignore-extensions=gif,jpg,png to do that. In this example we ignore those three extensions only.

For convenience, --ignore-static is equivalent to --ignore-extensions=gif,jpg,png,js,xlx,pptx,docx,css,ico,pdf.

The default timeout is 60000 milliseconds (60 seconds). You can change it with --timeout=20000.

Limitations

  • The CLF parsing is pretty basic and won't cope if you have extra fields before the regular fields (at the end is OK).

  • There is no support for automatically farming out requests to multiple machines to more accurately simulate traffic from many machines.

  • Only GET requests are simulated. It would be easy to simulate the HEAD requests as well. Since the contents of a POST request are not logged in CLF those cannot be simulated.

  • The entire log file is read into memory, parsed into objects, and sorted by datestamp, so you could run out of memory if you run this with a large log file. This is necessary because typical webservers write entries out of order to their log files, but there's a more efficient way I'm sure.

  • Any errors from node (rather than the webserver) result in the entire simulation run halting with an error. There shouldn't be any, and you certainly want to know if there are. Then again I'm running this with relatively tame log files.

  • The user agent is not configurable. Your webserver might treat it differently than a regular browser.

Changelog

0.1.1: passing --speed=2 runs through the log file at twice the actual speed it took place originally, etc. Passing --verbose prints URLs as soon as they are fetched as well as after the request ends.

0.1.0: initial release. Happy Thanksgiving Eve (US).

0.1.1: handle timeouts better. Default timeout is 60000 milliseconds, see --timeout option.

About P'unk Avenue and Apostrophe

holodeck was created at P'unk Avenue for use in testing websites built with Apostrophe, an open-source content management system built on node.js. holodeck isn't mandatory for Apostrophe and vice versa, but they play very well together. If you like holodeck you should definitely check out apostrophenow.org. Also be sure to visit us on github.

Support

Feel free to open issues on github.