Skip to content

Commit 740d44b

Browse files
author
Jeffrey Na
committed
Merge branch 'dev' into jeff
2 parents c65df31 + acf3322 commit 740d44b

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

app/charts/HealthChart.tsx

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,29 +39,35 @@ const HealthChart: React.FC<HealthChartProps> = React.memo(props => {
3939
};
4040

4141
// pulls the current service names to be shown in the graph title from chartData
42-
const serviceNamesAsString = (chartData: object): string => {
42+
const serviceNamesAsString = (chartDataObject: object): string => {
4343
let serviceNameString = '';
44-
for (const serviceName in chartData) {
44+
for (const serviceName in chartDataObject) {
4545
serviceNameString += `${serviceName} | `;
4646
}
4747
return serviceNameString;
4848
};
4949

5050
// generates an array of plotly data objects to be passed into our plotly chart's data prop
51-
const generatePlotlyDataObjects = (chartData: object): object[] => {
51+
const generatePlotlyDataObjects = (chartDataObj: object): object[] => {
5252
const arrayOfPlotlyDataObjects: PlotlyData[] = [];
5353
console.log('chartData:::::::: ', chartData);
5454
// iterate through the chartData
55-
for (const serviceName in chartData) {
55+
for (const serviceName in chartDataObj) {
56+
console.log('SERVICENAME: ', serviceName);
5657
// define the metrics for this service
57-
const metrics = chartData[serviceName];
58+
const metrics = chartDataObj[serviceName];
59+
console.log('METRICS: ', metrics);
5860
// loop through the list of metrics for the current service
5961
for (const metricName in metrics) {
62+
console.log('METRICNAME: ', metricName);
6063
// define the value and time arrays; allow data to be reassignable in case we need to convert the bytes data into megabytes
6164
let dataArray = metrics[metricName].value;
65+
console.log('DATAARRAY: ', dataArray);
6266
const timeArray = metrics[metricName].time;
67+
console.log('TIMEARRAY: ', timeArray);
6368
// specifically for `Megabyte` types, convert the original data of bytes into a value of megabytes before graphing
64-
if (dataType === 'Memory in Megabytes' || 'Cache in Megabytes') {
69+
if (dataType === 'Memory in Megabytes' || dataType === 'Cache in Megabytes') {
70+
console.log('DATATYPE: ', dataType);
6571
dataArray = dataArray.map(value => (value / 1000000).toFixed(2));
6672
}
6773
// create the plotly object
@@ -75,6 +81,7 @@ const HealthChart: React.FC<HealthChartProps> = React.memo(props => {
7581
colors: ['#fc4039', '#4b54ea', '#32b44f', '#3788fc', '#9c27b0', '#febc2c'],
7682
},
7783
};
84+
console.log('PLOTLYDATAOBJECT: ', plotlyDataObject)
7885
// push the dataObject into the arrayOfPlotlyDataObjects
7986
arrayOfPlotlyDataObjects.push(plotlyDataObject);
8087
}

app/containers/HealthContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ const HealthContainer: React.FC<HealthContainerProps> = React.memo(props => {
133133
typeGroupedObject[metricType][serviceName][metric] = metrics[metric];
134134
}
135135
}
136-
console.log('typeGroupedObject: ', typeGroupedObject);
136+
137137
return typeGroupedObject;
138138
};
139139

electron/routes/dataHelpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const mongoFetch = async (
3737
result = [{ [serviceName]: result }];
3838
return result;
3939
} catch (error) {
40-
console.error('Aggregation error in mongoFetch(): ', error);
40+
console.log('Aggregation error in mongoFetch(): ', error);
4141
}
4242
};
4343

@@ -67,7 +67,7 @@ const postgresFetch = async (
6767
result = [{ [serviceName]: result }];
6868
return result;
6969
} catch (error) {
70-
console.error('Query error in postgresFetch(): ', error);
70+
console.log('Query error in postgresFetch(): ', error);
7171
}
7272
};
7373

0 commit comments

Comments
 (0)