A cool chaos library for NodeJS

Eduardo Patrocinio
1 min readJan 3, 2018

--

I am creating a simple banking application (see description at https://medium.com/@epatro/running-distributed-transactions-in-kubernetes-19a8fa27758b), and I need to generate some disruptions.

Although it’s possible to do disruption at the Kubernetes POD level (see an implementation of Chaos Monkey at https://github.com/patrocinio/kubernetes-pod-chaos-monkey), I want to simulate failures at the code.

As I don’t want to contaminate the code with random failures, I decided to focus on implementing failures as part of the NodeJS express framework (https://expressjs.com/), and randomly generate errors such as:

  • Return 404 error
  • Slow down to respond (for a few seconds)

These errors will magnify the chaos (disruption) in a NodeJS code.

The NPM module is available at https://www.npmjs.com/package/patrocinio_chaos_router

--

--

Eduardo Patrocinio
Eduardo Patrocinio

Written by Eduardo Patrocinio

Principal Solutions Architect, Strategic Accounts, AWS

No responses yet