Git Product home page Git Product logo

chronos's Introduction

Chronos logo

Chronos

Microservice communication and health visualizer.

NPM Version NPM Downloads

const cmd = require('chronos-microservice-debugger3')
cmd.propagate()

app.use('/', cmd.microCom('microserviceName', 'databaseType', 'databaseURL', 'wantMicroHealth', 'queryFrequency'))

Features

  • HTTP request tracing
  • Speed and latency tracking
  • Process monitoring
  • Memory usage

Installation

Chronos consists of a Node module available through the npm registry and a lightweight Electron desktop application.

Node module

To begin, install the Chronos node module within each microservice of your application using the npm installcommand:

npm install chronos-microservice-debugger3

Once installed, write the following two lines at the top of each microservice's server file:

const cmd = require('chronos-microservice-debugger3');
cmd.propagate();

Then add a route handler for all incoming requests:

app.use('/', cmd.microCom('microserviceName', 'databaseType', 'databaseURL', 'wantMicroHealth', 'queryFrequency'))

The cmd.microCom handler function logs communication and health data to a user-provided database. This is to ensure that your private data stays private. We currently support MongoDB and SQL/PostgreSQL databases.

cmd.microCom takes four parameters and an optional fifth parameter. You can enter the arguments as individual strings or as an array.

The parameters are:

  1. microserviceName: To identify the microservice (i.e. "payments")
  2. databaseType: Enter either "mongo" or "sql"
  3. databaseURL: Enter the URL of your database
  4. wantMicroHealth: Do you want to monitor the health of this microservice? Enter "yes" or "no"
  5. queryFrequency (optional): How frequently do you want to log the health of this microservice? It defaults to every minute, but you can choose:
  • "s" : every second
  • "m" : every minute (default)
  • "h" : every hour
  • "d" : once per day
  • "w" : once per week

String parameter example:

app.use('/', cmd.microCom('payments', 'mongo', 'mongodb+srv://user:[email protected]/','yes','h'))

Array parameter example:

let values = [
  'payments',
  'mongo',
  'mongodb+srv://user:[email protected]/',
  'yes',
  'h'
]

app.use('/', cmd.microCom(values)

Electron desktop application

After installing the node module in each microservice, download the Electron desktop application from the public Chronos repo.

Inside the downloaded directory, install all dependencies using the npm install command followed by the npm start command to start the Electron desktop application.

Contributing

Chronos hopes to inspire an active community of both users and developers. For questions, comments, or contributions, please submit a pull request.

People

Tim Atapagra, Mohtasim Chowdhury, Ousman Diallo, Michelle Herrera, Duane McFarlane, Ben Mizel, Jenae Pennie, Chris Romano, Natalie Umanzor

License

MIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.