Skip to content

Commit 6c80bea

Browse files
Update README
1 parent 93f9bbb commit 6c80bea

File tree

1 file changed

+122
-43
lines changed

1 file changed

+122
-43
lines changed

README.md

Lines changed: 122 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,104 @@
22
<p align="center">
33
<img src="./app/assets/chronos-v4.png" height=300/>
44
</p>
5+
56
## Chronos
6-
Microservice communication, health, and Docker container visualizer.
7-
Comes with a middleware and an Electron app.
7+
8+
> A developer tool that monitors the health and web traffic of servers, microservices, and containers.
9+
10+
## Quick start
11+
12+
Install dependencies
13+
14+
```
15+
npm install chronos-tracker**
16+
```
17+
18+
Create `chronos-config.js`
19+
20+
```js
21+
const chronos = require('chronos-tracker');
22+
23+
cmd.use({
24+
microservice: 'chronos-mon-2', // Microservice name
25+
interval: 3000, // Interval to collect data
26+
dockerized: true,
27+
database: {
28+
// Switch these to MongoDB
29+
type: 'MongoDB',
30+
URI: /* NEW DATABASE URI */,
31+
},
32+
// Optional notifications
33+
notifications: [
34+
{
35+
type: 'slack', // Notifications for slack
36+
settings: {
37+
slackurl: /* YOUR SLACK WEBHOOK URL*/,
38+
},
39+
},
40+
// Email Notifications,
41+
{
42+
type: 'email',
43+
settings: {
44+
emails: /* EMAIL RECIPIENT LIST */,
45+
emailHost: /* EMAIL HOST */,
46+
emailPort: /* EMAIL PORT */,
47+
user: /* SENDER EMAIL ADDRESS */,
48+
password: process.env.EMAIL_PASSWORD,
49+
},
50+
},
51+
],
52+
});
53+
```
54+
55+
_NOTE: Email notification settings may require alternative security settings to work_
56+
57+
Initialize chronos
58+
59+
```js
60+
const express = require('express');
61+
const cmd = require('chronos-tracker');
62+
require('./cmd-config'); // Bring in config file
63+
64+
const app = express();
65+
66+
cmd.propagate();
67+
app.use('/', cmd.track());
68+
69+
const PORT = 3000;
70+
app.listen(PORT, () => console.log(`Server running on port ${PORT}`));
71+
```
72+
73+
74+
Download chronos [here]()
75+
76+
Upload your application to Chronos
77+
78+
Enjoy...
79+
80+
## NEW FEATURES FOR 4.0+ - Real-time Data and Docker Container Stats
81+
82+
- Improved user interface & experience
83+
- Real-time data monitoring
84+
- Decreased loading times
85+
- Automated notifications(Slack, email)
86+
- Easier to use configuration file
887

988
## Features
1089

11-
* NEW (3.0+): Docker container stats (e.g. ID, memory usage %, CPU usage %, running processes, etc.) (New middleware compiled from TypeScript.)
12-
* HTTP request tracing
13-
* Speed and latency tracking
14-
* Process monitoring
15-
* Memory usage
90+
<!-- * HTTP request tracing -->
1691

17-
## NEW FEATURE FOR 3.0+ - Logging Docker Container Stats
92+
- Docker container stats (e.g. ID, memory usage %, CPU usage %, running processes, etc.)
93+
- Speed and latency tracking
94+
- Process monitoring
95+
- Memory usage
96+
97+
## Installation
98+
99+
Chronos consists of a [Node](https://nodejs.org/en/) module available through the
100+
[npm registry](https://www.npmjs.com/) and a lightweight [Electron](https://electronjs.org/) desktop application.
101+
102+
## Usage
18103

19104
IMPORTANT: Give your containers the same names you use for arguments for microservice names. Read more about it under the INSTALLATION section below.
20105

@@ -25,17 +110,13 @@ For example, you can type the following when starting up a container:
25110
`docker run -v /var/run/docker.sock:/var/run/docker.sock [your-image-tag]`
26111

27112
If you're using docker-compose to start up multiple containers at once, you can add a `volumes` key for each of your services in the YAML file:
113+
28114
```
29115
volumes:
30116
- "/var/run/docker.sock:/var/run/docker.sock"
31117
```
32118

33-
*Note: This module leverages the features of [systeminformation](https://systeminformation.io/).
34-
35-
## Installation
36-
37-
Chronos consists of a [Node](https://nodejs.org/en/) module available through the
38-
[npm registry](https://www.npmjs.com/) and a lightweight [Electron](https://electronjs.org/) desktop application.
119+
\*Note: This module leverages the features of [systeminformation](https://systeminformation.io/).
39120

40121
#### Node module
41122

@@ -47,53 +128,50 @@ npm install chronos-microservice-debugger4
47128
```
48129

49130
Once installed, write the following two lines at the top of each microservice's server file:
50-
```javascript
51-
const cmd = require('chronos-microservice-debugger4');
52-
cmd.propagate();
53-
```
54131

55132
Then add a route handler for all incoming requests:
56-
```js
57-
app.use('/',
58-
cmd.microCom(
59-
'microserviceName',
60-
'databaseType',
61-
'databaseURL',
62-
'wantMicroHealth',
63-
'queryFrequency',
64-
'isDockerized'
65-
)
66-
)
67-
```
68133

69134
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.
70135

71136
cmd.microCom takes six parameters. You can enter the arguments as individual strings or as an array.
72137

73138
The parameters are:
74-
* [1] microserviceName: To identify the microservice (i.e. "payments").
139+
140+
- [1] microserviceName: To identify the microservice (i.e. "payments").
75141
- Make sure this name matches your container name. More details more below (param #6).
76142
- Your input name for the microservice will be turned to an all-lowercase string.
77-
* [2] databaseType: Enter either "mongo" or "sql".
78-
* [3] databaseURL: Enter the URL of your database.
79-
* [4] wantMicroHealth: Do you want to monitor the health of this microservice? Enter "yes" or "no".
143+
- [2] databaseType: Enter either "mongo" or "sql".
144+
- [3] databaseURL: Enter the URL of your database.
145+
- [4] wantMicroHealth: Do you want to monitor the health of this microservice? Enter "yes" or "no".
80146
- Note: If you choose "yes" for this param, the middleware will NOT log container stats. In other words, if you want container stats instead, input "no" here and "yes" for param #6.
81-
* [5] queryFrequency (optional): How frequently do you want to log the health of this microservice? It defaults to every minute, but you can choose:
147+
- [5] queryFrequency (optional): How frequently do you want to log the health of this microservice? It defaults to every minute, but you can choose:
82148
- "s" : every second
83149
- "m" : every minute (default)
84150
- "h" : every hour
85151
- "d" : once per day
86152
- "w" : once per week
87-
* [6] isDockerized: Is this microservice running in a Docker container? Enter "yes" or "no". (Defaults to "no".)
153+
- [6] isDockerized: Is this microservice running in a Docker container? Enter "yes" or "no". (Defaults to "no".)
88154
- IMPORTANT: When starting up the container, give it the same name that you used for the microservice, because the middleware finds the correct container ID of your container by matching the container name to the microservice name you input as 1st argument.
89155
- Don't forget to bind mount to Docker socket. See NEW FEATURE section above.
90156

91157
String parameter example:
158+
92159
```javascript
93-
app.use('/', cmd.microCom('payments', 'mongo', 'mongodb+srv://user:[email protected]/','yes','m','no'))
160+
app.use(
161+
'/',
162+
cmd.microCom(
163+
'payments',
164+
'mongo',
165+
'mongodb+srv://user:[email protected]/',
166+
'yes',
167+
'm',
168+
'no'
169+
)
170+
);
94171
```
95172

96173
Array parameter example:
174+
97175
```javascript
98176
let values = [
99177
'payments',
@@ -106,11 +184,12 @@ let values = [
106184

107185
app.use('/', cmd.microCom(values)
108186
```
187+
109188
#### Microservice Test Suite
110189
111-
Additionally, the repo includes a test suite of microservices utilizing the Chronos node module so that their communication, health, and container data can be logged. You can then visualize the data with the Electron app.
190+
Additionally, the repo includes a test suite of microservices utilizing the Chronos node module so that their communication, health, and container data can be logged. You can then visualize the data with the Electron app.
112191
113-
The microservices include individual Dockerfiles in their respective directories. A docker-compose.yml is in the root directory in case you'd like to deploy all services together.
192+
The microservices include individual Dockerfiles in their respective directories. A docker-compose.yml is in the root directory in case you'd like to deploy all services together.
114193
115194
Refer to the [README](https://github.com/oslabs-beta/Chronos/tree/docker/microservice) of that branch for more details.
116195
@@ -127,19 +206,19 @@ Chronos hopes to inspire an active community of both users and developers. For q
127206
## People
128207
129208
[Tim Atapagra](https://github.com/timpagra),
130-
[Brian Bui](https://github.com/Umius-Brian),
209+
[Brian Bui](https://github.com/Umius-Brian),
131210
[Mohtasim Chowdhury](https://github.com/mohtasim317),
132211
[Ousman Diallo](https://github.com/Dialloousman),
133212
[Michelle Herrera](https://github.com/mesherrera),
134-
[Alan Lee](https://github.com/ajlee12/),
213+
[Alan Lee](https://github.com/ajlee12/),
135214
[Duane McFarlane](https://github.com/Duane11003),
136215
[Ben Mizel](https://github.com/ben-mizel),
137-
[Alon Ofengart](https://github.com/alon25),
216+
[Alon Ofengart](https://github.com/alon25),
138217
[Jenae Pennie](https://github.com/jenaepen),
139218
[Chris Romano](https://github.com/robicano22),
140219
[Brianna Sookhoo](https://github.com/briannasookhoo),
141220
[Natalie Umanzor](https://github.com/nmczormick)
142221
143222
## License
144223
145-
[MIT](https://github.com/oslabs-beta/Chronos/blob/master/LICENSE.md)
224+
[MIT](https://github.com/oslabs-beta/Chronos/blob/master/LICENSE.md)

0 commit comments

Comments
 (0)