Skip to content

Dev #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 68 commits into from
Dec 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
dc79e9f
this commit is just so i can pull down the latest changest. ignore
Duane11003 Oct 3, 2019
459a059
this commit is behind...do not use
Duane11003 Oct 3, 2019
00e403c
Removed console.logs used for debugging.
mesherrera Oct 14, 2019
4248bb3
Successfully using data from details context.
mesherrera Oct 14, 2019
d43b28d
Moved setDetails and IPC communication to onClick function for each s…
mesherrera Oct 14, 2019
11837e1
Removed unnecessary bulk used for information gathering. Passing props.
mesherrera Oct 14, 2019
ec7c73f
Format adjustments.
mesherrera Oct 14, 2019
7947844
Reorganizing file structure
mesherrera Oct 14, 2019
4925c14
Debugged errors. Needs improved logic for line graph creation.
mesherrera Oct 14, 2019
3955e21
Restored electron package lock.
mesherrera Oct 14, 2019
df1d8f1
Restored electron package lock.
mesherrera Oct 14, 2019
653304e
Middleware package.json. Added file to middleware folder.
mesherrera Oct 14, 2019
9451d3c
Updated template.
mesherrera Oct 16, 2019
50a654d
Removed cemmented out code.
mesherrera Oct 16, 2019
351ca62
old commit
Duane11003 Oct 16, 2019
fd98301
added line chart for latency
Duane11003 Oct 17, 2019
7449232
Fixed formatting
mesherrera Oct 17, 2019
2bb0296
list
mesherrera Oct 17, 2019
e0aff4e
Fixed logic to filter chart data point to only the current service vi…
mesherrera Oct 17, 2019
cace159
Completed chart logic
mesherrera Oct 17, 2019
b106689
Prop drilled to communication charts. Added completed speed chart.
mesherrera Oct 17, 2019
d01695c
latency chart in progress. determingin whether the db is SQL or noSQL
Duane11003 Oct 18, 2019
bc43e25
Completed processes chart using ChartJS.
mesherrera Oct 18, 2019
37187c9
Added props to ensure that charts rendered only have information for …
mesherrera Oct 18, 2019
be153fa
Fixed formatting
mesherrera Oct 18, 2019
2cf6990
Added finished charts.
mesherrera Oct 18, 2019
e193d01
resolving merge conflicts
Duane11003 Oct 18, 2019
cec9fd3
Add back button.
mesherrera Oct 18, 2019
4d27f8e
List updated.
mesherrera Oct 18, 2019
fdfda97
Rexolved merge conflicts
mesherrera Oct 18, 2019
28b0d41
Formatting
mesherrera Oct 18, 2019
caadba4
Added temperature Chart
mohtasim317 Oct 18, 2019
2a17a5b
Added temperature title
mohtasim317 Oct 18, 2019
5796087
we can get rid of this
mohtasim317 Oct 18, 2019
08464e6
Adding temperature chart
mohtasim317 Oct 18, 2019
d304ed9
Merging
mesherrera Oct 18, 2019
ba52019
Removing bundle.
mesherrera Oct 18, 2019
8ac9baa
Removed templates
mesherrera Oct 18, 2019
0adbf38
Formatting.
mesherrera Oct 18, 2019
aebce37
Removed duplicate file.
mesherrera Oct 18, 2019
f043850
Formatting.
mesherrera Oct 18, 2019
dcb526a
Fixed variable declaration.
mesherrera Oct 18, 2019
3af21f9
Commented out unused import.
mesherrera Oct 18, 2019
131df1e
Formatting.
mesherrera Oct 18, 2019
9ea3c22
additional styling on buttons, and h3 headers
Duane11003 Oct 18, 2019
e437cb5
Removed unnecessary useState hook.
mesherrera Oct 18, 2019
15c3011
Formatting.
mesherrera Oct 18, 2019
00eb191
Merge branch 'electron-react' of https://github.com/oslabs-beta/Chron…
mesherrera Oct 18, 2019
3998b65
Button style.
mesherrera Oct 18, 2019
0ab8cbe
Completed memory chart.
mesherrera Oct 21, 2019
2bb68a9
Added memory chart
mesherrera Oct 21, 2019
7d4d379
Commented chart files.
mesherrera Oct 21, 2019
c6bf658
Updated comments on hard coded solutions.;
mesherrera Oct 21, 2019
b3e291b
Added comments on connection functions.
mesherrera Oct 21, 2019
1e5b70f
Default settings.
mesherrera Oct 21, 2019
d62dd8a
Removed unecessary conditional statement. Added comments.
mesherrera Oct 21, 2019
ad6d38a
Removed unecessary conditional statement. Added comments.
mesherrera Oct 21, 2019
618a865
Restored defaults.
mesherrera Oct 21, 2019
a134527
Replaced GettingStarted with AddService.
mesherrera Oct 21, 2019
4379e8e
Removed unnecessary import of GettingStarted
mesherrera Oct 21, 2019
a7de58e
Removed unnecessary component.
mesherrera Oct 21, 2019
da73c1a
Updated import statement and rendered element for Add Database to Add…
mesherrera Oct 21, 2019
2670522
Added comments
mesherrera Oct 21, 2019
3beaac0
Added comments
mesherrera Oct 21, 2019
3ee80bf
Added comments
mesherrera Oct 21, 2019
1d3c334
Added comments.
mesherrera Oct 21, 2019
140a26a
Added comments
mesherrera Oct 21, 2019
08dc0a0
Merge branch 'electron-react' into dev
Dec 17, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ ipcMain.on('submit', (message, newService) => {
encoding: 'UTF-8',
}),
);
// if statement is used to remove hard coded data.
// 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.
if (state.michelleWasHere) {
state.setupRequired = false;
state.michelleWasHere = false;
Expand Down Expand Up @@ -134,7 +134,6 @@ ipcMain.on('detailsRequest', (message, index) => {
message.sender.send('detailsResponse', JSON.stringify(err));
}
const queryResults = JSON.stringify(data);
console.log('QUERY RESULTS =>', queryResults);
// Asynchronous event emitter used to transmit query results back to the render process.
message.sender.send('detailsResponse', queryResults);
});
Expand Down
File renamed without changes.
File renamed without changes.
50 changes: 0 additions & 50 deletions app/charts/detail-chart-template.jsx

This file was deleted.

37 changes: 37 additions & 0 deletions app/charts/latency-chart.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import React, { useContext } from 'react';
import { Line } from 'react-chartjs-2';
import HealthContext from '../context/DetailsContext';

const LatencyChart = (props) => {
const xAxis = [];
const yAxis = [];
const healthData = useContext(HealthContext).detailData;
for (let i = 0; i < healthData.length; i++) {
const element = healthData[i];
if (element.currentmicroservice === props.service || element.currentMicroservice === props.service) {
xAxis.push(i);
yAxis.push(element.latency);
}
}
const chartData = {
datasets: [
{
label: `CPU latency of ${props.service}`,
data: yAxis,
backgroundColor: ['rgb(254, 255, 0)'],
},
],
options: {
xAxisID: 'TBD',
yAxisID: 'TBD',
},
labels: xAxis,
};
return (
<div>
<Line data={chartData} />
</div>
);
};

export default LatencyChart;
74 changes: 32 additions & 42 deletions app/charts/memory-chart.jsx
Original file line number Diff line number Diff line change
@@ -1,79 +1,69 @@
import React, { useContext } from 'react';
import { Line } from 'react-chartjs-2';
import { Bar } from 'react-chartjs-2';
import HealthContext from '../context/DetailsContext';

const MemoryChart = () => {
const healthData = useContext(HealthContext);
// const health = healthData.detailData;
const MemoryChart = (props) => {
const healthData = useContext(HealthContext).detailData;

const createChart = () => {
let free = [];
let used= [];
let active = [];
let total = [];
const xAxis = [];
const free = [];
const used = [];
const active = [];
const total = [];

for (let i = 0; i < healthData.length; i += 1) {
xAxis.push(i);
// If Mongo
if (healthData[i].freeMemory && healthData[i].activeMemory && healthData[i].usedMemory && healthData[i].totalMemory) {
if (healthData[i].currentMicroservice === props.service) {
free.push(healthData[i].freeMemory);
active.push(healthData[i].activeMemory);
used.push(healthData[i].usedMemory);
total.push(healthData[i].totalMemory);
} else {
}

// If SQL
if (healthData[i].currentmicroservice === props.service) {
free.push(healthData[i].freememory);
active.push(healthData[i].activememory);
used.push(healthData[i].usedmemory);
total.push(healthData[i].totalmemory);
}
}



const memoryObj = {
freeMem: free,
usedMem: used,
activeMem: active,
totalMem: total
}

const chartData = {
datasets: [
{
label: "Free Memory",
data: Object.values(memoryObj.freeMem),
backgroundColor: [
"rgb(2, 210, 249)"
]
label: 'Free Memory',
backgroundColor: 'rgb(2, 210, 249)',
data: free,
// showLine: true,
},
{
label: "Used Memory",
data: Object.values(memoryObj.usedMem),
backgroundColor: [
"rgb(198, 42, 177)",
]
label: 'Used Memory',
backgroundColor: 'rgb(239, 91, 145)',
data: used,
// showLine: true,
},
{
label: "Active Memory",
data: Object.values(memoryObj.activeMem),
backgroundColor: [
"rgb(252, 170, 52)"
]
label: 'Active Memory',
backgroundColor: 'rgb(182, 219, 26)',
data: active,
// showLine: true,
},
{
label: "Total Memory",
data: Object.values(memoryObj.activeMem),
backgroundColor: [
"rgb(239, 91, 145)"
]
label: 'Total Memory',
backgroundColor: 'rgb(252, 170, 52)',
data: total,
// showLine: true,
},
],
labels: ["Free Memory", "Active Memory", "Used Memory", "Total Memory"]
labels: xAxis,
};

return <Line data={chartData} />;
return <Bar data={chartData} />;
};

// Return div with helper function invoked
return <div>{createChart()}</div>;
};

Expand Down
61 changes: 61 additions & 0 deletions app/charts/processes-chart.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import React, { useContext } from 'react';
import { Bar } from 'react-chartjs-2';
import HealthContext from '../context/DetailsContext';

const ProcessesChart = (props) => {
const healthData = useContext(HealthContext).detailData;
const createChart = () => {
const communicationLabel = [];
const totalProcesses = [];
const runningProcesses = [];
const blockedProcesses = [];
const sleepingProcesses = [];

for (let i = 0; i < healthData.length; i += 1) {
const element = healthData[i];
// If using a SQL Database
if (element.currentmicroservice === props.service) {
communicationLabel.push(i);
totalProcesses.push(element.totalnumprocesses);
runningProcesses.push(element.numrunningprocesses);
blockedProcesses.push(element.numblockedprocesses);
sleepingProcesses.push(element.numsleepingprocesses);
}
// If using a Mongo Database
if (element.currentMicroservice === props.service && element.cpuCurrentSpeed) {
communicationLabel.push(i);
totalProcesses.push(element.numTotalProcesses);
runningProcesses.push(element.numRunningProcesses);
blockedProcesses.push(element.numBlockedProcesses);
sleepingProcesses.push(element.numSleepingProcesses);
}
}

const chartData = {
datasets: [{
label: 'Blocked Processes',
backgroundColor: 'rgb(198, 42, 177)',
data: blockedProcesses,
}, {
label: 'Sleeping Processes',
backgroundColor: 'rgb(252, 170, 52)',
data: sleepingProcesses,
}, {
label: 'Running Processes',
backgroundColor: 'rgb(239, 91, 145)',
data: runningProcesses,
}, {
label: 'Total Processes',
backgroundColor: 'rgb(182, 219, 26)',
data: totalProcesses,
}],
labels: communicationLabel,
};

return <Bar data={chartData} />;
};

return <div>{createChart()}</div>;
};

export default ProcessesChart;
14 changes: 6 additions & 8 deletions app/charts/request-type-chart.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ import React, { useContext } from 'react';
import { Doughnut } from 'react-chartjs-2';
import CommunicationsContext from '../context/OverviewContext';

const RequestTypesChart = () => {
const communicationsData = useContext(CommunicationsContext);
const communications = communicationsData.overviewData;
const RequestTypesChart = (props) => {
const communicationsData = useContext(CommunicationsContext).overviewData;

const createRequestChart = () => {
const requestObj = {
Expand All @@ -16,18 +15,17 @@ const RequestTypesChart = () => {
PUT: 0,
};

for (let i = 0; i < communications.length; i += 1) {
const element = communications[i];
for (let i = 0; i < communicationsData.length; i += 1) {
const element = communicationsData[i];
// if Mongo
if (element.reqType in requestObj) requestObj[element.reqType] += 1;
if (element.currentMicroservice === props.service && element.reqType in requestObj) requestObj[element.reqType] += 1;
// if SQL
else if (element.reqtype in requestObj) requestObj[element.reqtype] += 1;
else if (element.currentmicroservice === props.service && element.reqtype in requestObj) requestObj[element.reqtype] += 1;
}

const chartData = {
datasets: [
{
label: 'Breakdown of Requests by Type',
data: Object.values(requestObj),
backgroundColor: [
'rgb(2, 210, 249)',
Expand Down
Loading