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

lambda-shearer

v1.2.0

Published

Node CLI tool that helps to configure AWS Lambda function resources properly

Downloads

19

Readme

🐑 lambda-shearer ✂️

lambda-shearer is a Node CLI tool that helps to configure AWS Lambda function resources properly. It runs lambda function with a predefined set of memory settings and returns min/max/average for each. This way, it is easier to make a decision about optimal configuration based on needs and cost.

Usage

Requires Node 8.10 or higher. AWS credentials must be preconfigured before use.

npm install -g lambda-shearer
> lambda-shearer -h

Options:
  --lambda, -l       lambda function name or ARN                      [required]
  --payload, -p      path to a file that contains JSON payload or function that
                     produces one (is invoked with one argument: index)
                                                                      [required]
  --region, -r       AWS region
  --repeats, -n      number of lambda function invocations for each memory
                     setting                                       [default: 10]
  --concurrency, -c  number of concurrent invocations to use        [default: 1]
  --delay, -d        delay before each invoke                       [default: 0]
  --verbose, -v      print verbose output                       [default: false]
  --steps, -s        comma-separated list of memory settings, in MB, for your
                     lambda function to be tested with                [required]
  --warmup, -w       perform warmup call before actual benchmark [default: true]
  --timer, -t        method to use for measuring duration
                           [choices: "execution", "wall"] [default: "execution"]

Example:

> lambda-shearer -l <function name or ARN> -s 128,512,1024 -r us-east-1 -n 100 -p ./payload.json

RESULTS:
128MB:
        MIN: 5465ms
        MAX: 8540ms
        AVG: 6868ms
        P50: 5565ms
        P66: 5812ms
        P75: 6368ms
        P80: 6410ms
        P90: 6599ms
        P95: 6641ms
        P98: 6768ms
        P99: 6820ms
512MB:
        MIN: 1292ms
        MAX: 2350ms
        AVG: 1696ms
        P50: 1300ms
        P66: 1449ms
        P75: 1533ms
        P80: 1642ms
        P90: 1875ms
        P95: 1990ms
        P98: 2000ms
        P99: 2125ms
1024MB:
        MIN: 495ms
        MAX: 896ms
        AVG: 690ms
        P50: 50ms
        P66: 160ms
        P75: 240ms
        P80: 240ms
        P90: 350ms
        P95: 400ms
        P98: 490ms
        P99: 590ms

Limitations

Tool does not handle failed invocations.

Code style

This repository is configured with EditorConfig and ESLint rules.

Contributing

Contributors and PRs are always welcome.

License

The MIT License (MIT)

Copyright (c) 2017-2019 Anton Bazhal

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.