Skip to content

Commit 1382d3e

Browse files
committed
console logs added for traverseal of npm package
1 parent 5e8a6fd commit 1382d3e

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

chronos_npm_package/chronos.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ class Chronos {
7070
* endpoint that the user Request travels through (tracked with hpropograte) for express routes
7171
*/
7272
if (database.type === 'MongoDB') {
73+
//MONGO IS NOT ACTUAL MONGO, its a separate function imported from the controllers file
74+
console.log("MIKE YOOOOOOOOOOO",this.config)
7375
mongo.connect(this.config);
7476
mongo.services(this.config);
7577
// console.log('dockerized really? chronos.js LN 75', dockerized, this.config)

chronos_npm_package/controllers/healthHelpers.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ healthHelpers.collectHealthData = () => {
6767
*/
6868
si.cpu()
6969
.then(data => {
70+
// console.log(data)
7071
const siMethodName = 'cpu';
7172
for (let metricName in collectedMetrics[siMethodName]) {
7273
healthDataCollection.push({
@@ -76,6 +77,7 @@ healthHelpers.collectHealthData = () => {
7677
time,
7778
});
7879
}
80+
// console.log('CPU HEALTH METRICS',healthDataCollection)
7981
})
8082
.catch(err => {
8183
if (err) {
@@ -203,6 +205,8 @@ healthHelpers.collectHealthData = () => {
203205
category: 'Latency',
204206
time,
205207
});
208+
console.log("HEALTH METRICS PRE PROMISE",healthDataCollection)
209+
206210
})
207211
.catch(err => {
208212
if (err) {
@@ -213,11 +217,13 @@ healthHelpers.collectHealthData = () => {
213217
/** Return a promise that resolves to an array of all of the data points
214218
* and removes any empty strings, NaN, or "NaN" from values prevent database errors
215219
*/
216-
return Promise.all(healthDataCollection).then(array =>
217-
array.filter(metric => {
220+
return Promise.all(healthDataCollection).then(array => {
221+
// console.log("PROMISE ARRAY",array)
222+
return array.filter(metric => {
218223
if (isNaN(metric.value) || metric.value === 'NaN' || metric.value === '') return false;
219224
else return true;
220225
})
226+
}
221227
);
222228
};
223229

chronos_npm_package/controllers/utilities.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ const helpers = {
111111

112112
addNotifications: config => {
113113
const { notifications } = config;
114+
//POTENTIAL BUG: notifications defaults to an empty array so it should always be truthy. I think code will fire regardless
114115
if (notifications) {
115116
// Current notification methods supported
116117
const features = ['slack', 'email', 'sms'];

0 commit comments

Comments
 (0)