You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// if statement is used to replace hard coded data. Hard coded data and the michelleWasHere key is needed to avoid a load error caused by Electron querying the database before a user has added or selected a database.
63
-
if(state.michelleWasHere){
68
+
// if statement is used to replace hard coded data. Hard coded data is needed to avoid a load error caused by Electron querying the database before a user has added or selected a database.
69
+
if(state.setupRequired){
64
70
state.setupRequired=false;
65
-
state.michelleWasHere=false;
66
71
state.services=[JSON.parse(newService)];
72
+
//is updating the /user/settings.json file with the first new service
//queryResults is an array of objects with the following keys {"_id","currentMicroservice","targetedEndpoint","reqType","timeSent","resStatus","resMessage","__v"}
103
118
constqueryResults=JSON.stringify(data);
119
+
104
120
// Asynchronous event emitter used to transmit query results back to the render process.
constgetCommunications='SELECT * FROM communications';
112
128
pool.query(getCommunications,(err,result)=>{
113
129
if(err){
114
-
console.log(err);
115
-
message.sender.send(JSON.stringify('Database info could not be retreived.'));
130
+
returnmessage.sender.send(JSON.stringify('Database info could not be retrieved.'));
116
131
}
132
+
console.log('Connected to SQL Database')
133
+
//queryResults is an array of objects with the following keys {"id","currentmicroservice","targetedendpoint","reqtype","resstatus","resmessage","timesent"}
117
134
constqueryResults=JSON.stringify(result.rows);
118
135
// Asynchronous event emitter used to transmit query results back to the render process.
Chronos Microservice Debugger consists of an npm package with an optional Electron front end to visualize and monitor your microservices.
1
+
#Chronos
2
+
Chronos consists of an NPM package to be required into a user’s microservices that intercepts all http and gRPC microservice communications, as well as monitors the health of each microservice over time. This information is written to a user-owned database (PostgreSQL or NoSQL) where it is queried and rendered by the frontend utilizing Node in conjunction with a native, cross-platform Electron desktop application with React components to ensure agreement between the frontend and database.
3
3
4
-
## Install
4
+
## Why was Chronos created?
5
+
As companies grow larger and begin to scale, they have a tendency to move from a monolithic code architecture and microservices and distributed systems architecture in order to build faster, more maintainable code.
6
+
7
+
The process of modularizing a code bases and breaking a monolith into individual services can be a daunting task. How do you break apart and re-connect these services? There is often a transitional period where valuable time is spent debugging these connections between services.
8
+
9
+
Chronos is deigned to meet the needs of companies and developers working to break down their monoliths into distributed systems by combining an NPM package together with an Electron application to monitor and assist in the debugging of their services.
10
+
11
+
## How to Install Chronos
12
+
The Chronos-Microservice-Debugger Express Middleware can be found on npm: https://www.npmjs.com/package/chronos-microservice-debugger
13
+
14
+
To install the NPM package:
5
15
```javascript
6
16
npm install chronos-microservice-debugger
7
17
```
8
18
9
-
## Usage
19
+
The Chronos Electron application is in progress and will soon be availble for public download for all platforms. Please stay tuned.
20
+
21
+
## How to Use Chronos
10
22
There are two main aspects to Chronos-Microservice-Debugger
11
-
*Communication Monitor: Listens in on all microservice-microservice and microservice-client communication and monitors the response statuses and messages to ensure communications are making it to the correct destination successfully.
12
-
*Health Monitor: The health monitor checks the status of your microservice every second and sends this health information to an optional electron frontend where it is visualized for easier use.
23
+
1. Communication Monitor: Listens in on all microservice-microservice and microservice-client communication and monitors the response statuses and messages to ensure communications are making it to the correct destination successfully.
24
+
2. Health Monitor: The health monitor checks the status of your microservice every second and sends this health information to an optional electron frontend where it is visualized for easier use.
25
+
26
+
To use the npm package, there are three required parameters and an optional fourth parameter. You can enter the items as individual strings or as an array containing the three required parameters and one optional parameter.
13
27
28
+
The parameters are:
29
+
1. microserviceName: What do you want to name the current microservice
30
+
2. databaseType: We currently support PostgreSQL and Mongo. Enter "mongo" or "sql"
31
+
3. databaseURL: Where would you like to store your information? Enter the URL to your database
32
+
4. queryFrequency: How often do you want microHealth to monitor the health of your database? It defaults to every second, but you can choose:
Chronos uses a user-owned and provided database to ensure that your private data stays private. We currently support MongoDB and SQL/PostgreSQL databases.
20
52
21
-
## Things in the Works
22
-
*gRPC support
23
-
*Ability to determine how often your microservice health is monitored (currently every second)
24
-
*'Time Travel' to see how your microservices have changed over time
25
-
*Docker health information for containerized microservices
26
-
*Implement additional unit testing
53
+
Array parameter example:
54
+
```javascript
55
+
let values = [
56
+
'microserviceName',
57
+
'databaseType',
58
+
'databaseURL',
59
+
'queryFrequency'
60
+
]
61
+
// How to use chronos-micrservice-debugger with an array parameter
// Note: microCom does not utilize queryFreq because it logs all communication when an endpoint is hit
76
+
77
+
chronos-microservice-debugger.microHealth(values)
78
+
79
+
```
31
80
32
-
## Contact Us
33
-
For questions, requests, or more information, please contact us at teammicronos@gmail.com
81
+
## How to Contribute to Chronos
82
+
Chronos hopes to inspire an active community of both users and developers. For questions, comments, suggestions, please contact us at teammicronos@gmail.com or submit a pull request.
{/* the select e.target.value of onchange is reading the value SQL and MongDB, the value the setState is delay by one action. Stack Over Flow says the action is an async call so dbState is updated late. So I did another setDbtype callwith useEffect*/}
0 commit comments