Skip to content

Commit 061f219

Browse files
authored
Professionalized
1 parent ceb9533 commit 061f219

1 file changed

Lines changed: 54 additions & 17 deletions

File tree

README.md

Lines changed: 54 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
![Chronos logo](https://raw.githubusercontent.com/Chronos2-0/Chronos/master/app/assets/logo2.png)
2-
2+
## Chronos
33
Microservice communication and health visualizer.
44

55
[![NPM Version][npm-image]][npm-url]
@@ -12,27 +12,69 @@ cmd.propagate()
1212
app.use('/', cmd.microCom('microserviceName', 'databaseType', 'databaseURL', 'wantMicroHealth', 'queryFrequency'))
1313
```
1414

15-
## Installation
15+
## Features
16+
17+
* HTTP request tracing
18+
* Speed and latency tracking
19+
* Process monitoring
20+
* Memory usage
1621

17-
This is a [Node.js](https://nodejs.org/en/) module available through the
18-
[npm registry](https://www.npmjs.com/).
22+
## Installation
1923

20-
Before installing, [download and install Node.js](https://nodejs.org/en/download/).
21-
Node.js 0.10 or higher is required.
24+
Chronos consists of a [Node](https://nodejs.org/en/) module available through the
25+
[npm registry](https://www.npmjs.com/) and a lightweight [Electron](https://electronjs.org/) desktop application.
2226

23-
Installation is done using the
27+
To begin, install the [Chronos](https://www.npmjs.com/package/chronos-microservice-debugger3) Node module within each microservice of your application using the
2428
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
2529

2630
```bash
2731
$ npm install chronos-microservice-debugger3
2832
```
2933

30-
## Features
34+
Once installed, place the following two lines in the microservice's server file before requiring 'express':
35+
```javascript
36+
const cmd = require('chronos-microservice-debugger3');
37+
cmd.propagate();
38+
```
3139

32-
* HTTP request tracing
33-
* Speed and latency tracking
34-
* Process monitoring
35-
* Memory usage
40+
Then add a route handler for all incoming requests:
41+
```js
42+
app.use('/', cmd.microCom('microserviceName', 'databaseType', 'databaseURL', 'wantMicroHealth', 'queryFrequency'))
43+
```
44+
45+
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.
46+
47+
cmd.microCom has four parameters and an optional fifth parameter. You can enter the arguments as individual strings or as an array.
48+
49+
The parameters are:
50+
1. microserviceName: To identify the microservice (i.e. "payments")
51+
2. databaseType: Enter either "mongo" or "sql"
52+
3. databaseURL: Enter the URL of your database
53+
4. wantMicroHealth: Do you want to monitor the health of this microservice? Enter "yes" or "no"
54+
5. queryFrequency (optional): How frequently do you want the log the health of this microservice? It defaults to every minute, but you can choose:
55+
* "s" : every second
56+
* "m" : every minute (default)
57+
* "h" : every hour
58+
* "d" : once per day
59+
* "w" : once per week
60+
61+
String parameter example:
62+
```javascript
63+
app.use('/', cmd.microCom('payments', 'mongo', 'mongodb+srv://user:password@cluster0-abcdefg.mongodb.net/','yes','h'))
64+
```
65+
66+
Array parameter example:
67+
```javascript
68+
let values = [
69+
'payments',
70+
'mongo',
71+
'mongodb+srv://user:password@cluster0-abcdefg.mongodb.net/',
72+
'yes',
73+
'h'
74+
]
75+
76+
app.use('/', cmd.microCom(values)
77+
```
3678
3779
## Contributing
3880
@@ -50,8 +92,3 @@ Chronos hopes to inspire an active community of both users and developers. For q
5092
[npm-url]: https://www.npmjs.com/package/chronos-microservice-debugger3
5193
[downloads-image]: https://img.shields.io/npm/dm/chronos-microservice-debugger3.svg
5294
[downloads-url]: https://npmjs.org/package/chronos-microservice-debugger3
53-
54-
## How can I use Chronos?
55-
1. Go to https://www.npmjs.com/package/chronos-microservice-debugger and follow the instructions to install the NPM package within each microservice of your application
56-
2. Download this repo
57-
3. Inside the downloaded directory, run `npm install` followed by `npm start`

0 commit comments

Comments
 (0)