Skip to content

Commit

Permalink
Cleaned up Rerender files and added notes for future iterators.
Browse files Browse the repository at this point in the history
  • Loading branch information
lherna05 committed Sep 21, 2022
1 parent 550195e commit 7e12401
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
12 changes: 8 additions & 4 deletions src/PerformanceDashboard/PerformanceDashboard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
const {ipcRenderer} = require('electron');
/* **NOTE: The commented out code below was intended to run the 'npm run performanceSS' script in SvelteStorm. This
would help direct the User's flow (since the Dashboard needs to be open before the script runs to capture all the data).
The idea was that on click of the start button, the script would run and on click of the End button, ctl C would run to
end the session. More time is needed to ensure the commands are running for the application running in SvelteStorm
and not SvelteStorm itself.
*/
// const path = appBeingDebugedPath;
// const startSession = (err, data, stderr) => {
Expand All @@ -21,9 +27,7 @@
// // Printing error if occurs
// console.error('error while changing directory in PeformanceDashboard: ', {err});
// }
// cmd.run(`npm run performanceSS`, (err) => console.log('An error occurred while starting Perf Monitoring: ', {err}));
// cmd.run(`npm run performanceSS`, (err) => console.log('An error occurred while starting Perf Monitoring: ', {err}));
// }
// const endSession = (err, data, stderr) => {
Expand Down Expand Up @@ -84,6 +88,6 @@
}
.component-holder {
padding: 10px;
padding: 5px;
}
</style>
7 changes: 6 additions & 1 deletion src/PerformanceDashboard/RerenderChart.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import { slide } from 'svelte/transition';
const { ipcRenderer } = require('electron');
/*After the application in SvelteStorm is launched, this function receives data related to
the # of renders for each component. */
ipcRenderer.on('PERFORMANCE', (event, args) => {
countObj = args.body.compCounts;
console.log({countObj})
Expand All @@ -12,6 +14,8 @@
let componentRerenderCountArr = [];
let countObj;
/*Whenever data is received, this function sorts through and populates the componentRerenderCountArr
with {component: [name], count: [num]} objects for the D3 visualization */
const populateRerenderCountArr = (obj) => {
const tempRenderCountArr = [];
for (const key in obj) {
Expand All @@ -24,6 +28,8 @@
console.log({componentRerenderCountArr});
}
/*Below is the setup for the bar chart using the data from componentRerenerCountArr. */
let width = 600;
let height = 400;
Expand Down Expand Up @@ -132,7 +138,6 @@
.graph-title::before {
--translate-y: calc(100% + var(--arrow-size));
content: attr(data-tooltip);
font-size: .9rem;
color: rgb(20, 20, 20);
Expand Down

0 comments on commit 7e12401

Please sign in to comment.