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

chaos-monkey-browser

v0.1.3

Published

A 'chaos monkey'-style mischief maker that operates on the client.

Downloads

19

Readme

chaos-monkey-browser

A 'chaos monkey'-style mischief maker that operates on the client

What is Chaos Monkey?

Chaos Monkey is an idea originally outlined by the Netflix tech team.

The basic idea is to have something in your stack that causes random failures in your system, so you’ll be forced to make your app resilient against random failure.

What is chaos-monkey-browser?

chaos-monkey-browser is failure module that installs entirely on the client. This is particularly useful for apps that use multiple backends or when developers don't have an easy method for modifying a remote dependency.

Inspired by Chaos Monkeyware

Usage

The failure propability is configurable (0.0 - 1.0 with 1.0 equal to 100%). The default is 0.1.

The currently included failure modes (called mischiefs) are:

  • Delay – provides the normal HTTP response, but with an added (random) delay of 1-5 seconds.
  • HTTP 403 Access Denied
  • HTTP 404 Not Found
  • HTTP 500 Internal Server Error

Currently, all of these mischiefs have equal propability. Mischiefs can be enabled independently by passing in only the desired mischiefs.

By default, all methods [GET,POST,PUT,DELETE] allow failure. Methods can be enabled independently by passing in only the desired methods.

chaos-monkey-browser is AMD-aware. It can be used with or without require.js.

Example

   var props = {
      probability:0.5,
      allowedMethods:['GET'],
      mischiefTypes:[
        ChaosMonkey.MischiefTypes.delay,
        ChaosMonkey.MischiefTypes.http403
      ]
    };
    ChaosMonkey(props);

For more detailed examples, see index.html and amd.html in the examples folder.

Requirements

chaos-monkey-browser works by overriding the jquery ajax call. Consequently, jquery is required. Asynchronous http calls that call the browser XMLHttpRequest API directly will not be intercepted.