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

nginx-replay

v1.0.3

Published

A simple tool for replaying requests from nginx log file to the custom server

Downloads

12

Readme

nginx-replay

A simple tool for replaying requests from nginx log file to the custom server.

MIT License

Installation

npm i -g nginx-replay

Usage

Usage of nginx-replay:

Options:
  -f, --filePath <path>                        path of the nginx logs file
  -p, --prefix <url>                           url for sending requests
  -r, --ratio <number>                         acceleration / deceleration rate of sending requests, eg: 2, 0.5 (default: "1")
  --format <string>                            format of the nginx log (default: "$remote_addr - $remote_user [$time_local] \"$request\" $status $body_bytes_sent \"$http_referer\" \"$http_user_agent\"")
  -d --debug                                   show debug messages in console (default: false)
  -l, --logFile <path>                         save results to the logs file (default: "")
  -t, --timeout <int>                          timeout fo the requests
  --username <string>                          username for basic auth
  --password <string>                          password  for basic auth
  --scaleMode                                  experimental mode for the changing requests order (default: false)
  --skipSleep                                  remove pauses between requests. Attention: will ddos your server (default: false)
  --skipSsl                                    skip ssl errors (default: false)
  -s, --stats                                  show stats of the requests (default: false)
  --deleteQueryStats <comma separated string>  delete some query for calculating stats, eg: "page,limit,size" (default: "")
  --statsOnlyPath                              keep only endpoints for showing stats (default: false)
  --hideStatsLimit <int>                       limit number of stats
  -h, --help                                   display help for command
# Replay access log
nginx-replay -f nginx-acces.log -p localhost -d -l out.log -s

Output log format

Log is 5 spaces separated values:

replay-status   original-status   start-time-at-log   replay-start-time   duration   url

     403              200           1619052383000       1619433520324       0.32     /enpoint?page=1
  • replay-status is integer
  • original-status is integer
  • start-time-at-log is unix timestamp in ms
  • replay-start-time is unix timestamp in ms
  • duration is in seconds
  • url is string like in nginx log file

What is stats?

Calculated list of top urls. You can hide some rare requests by passing hideStatsLimit option. Also you can remove some or all query by passing deleteQueryStats or statsOnlyPath options.

What is final info?

Some useful information and statistic about requests, rps, errors end etc.

License

MIT