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

artillery-plugin-uuid

v0.0.1

Published

generate uuid to use in artillery script

Downloads

109

Readme

artillery-plugin-uuid

A plugin for artillery.io that generates UUID (version 4) variables for use in script

To use:

  1. npm install -g artillery
  2. npm install -g artillery-plugin-uuid (omit -g if it will be loaded from the local node_modules directory)
  3. add uuid plugin to your hello.yml Artillery script:
config:
  plugins:
    uuid:
      vars: [ 'id1' , 'id2' ] # array of variable names
  target: "https://aws.amazon.com"
  phases:
    -
      duration: 5 # time in seconds script will run
      arrivalRate: 1 # requests/second
scenarios:
  - flow:
    - options: # see footnote (a)
       url: '/'
       beforeRequest: addUUID  # request-level hook. each call will reset variable values to a new UUID
    - post:
        url: '/{{ id1 }}' # {{ id1 }} replaced by UUID assigned to id1
    - get:
        url: '/{{ id1 }}' # {{ id1 }} replaced by UUID assigned to id1
    - post:
        url: '/{{ id2 }}' # {{ id2 }} replaced by UUID assigned to id2
    - get:
        url: '/{{ id2 }}' # {{ id2 }} replaced by UUID assigned to id2
  1. create scenario-level (and sub-scenario-level) hooks wherever you would like UUID values to be regenerated (see footnote (b) for verbose explanation)
  2. artillery run hello.yml
footnotes

(a) VERY IMPORTANT! Variables are not avaiable in the flow entry that generates them. If you implement the hook within the post or get, artillery will not create the variable in time for use. Using options, we enable calling beforeRequest prior to entering the request bodies, and the variables are ready for use within requests.

(b) The level at which the hook is created determines the frequency at which the plugin is called. The example script generates a request-level hook. This creates one set of UUID's to be used for all requests within the flow. Generating a flow-level hook, on the other hand, will generate new UUID's with each new request.