Skip to content
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

various dope updates #32

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,6 @@
"./node_modules/.bin/prettier --write --no-semi --single-quote",
"git add"
]
}
},
"dependencies": {}
}
8 changes: 7 additions & 1 deletion src/extension/components/Buttons.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'

export function Buttons({ theme, clear, reload }) {
export function Buttons({ theme, clear, reload, update }) {
return (
<React.Fragment>
<button className={theme === 'dark' ? 'dark-btn' : 'btn'} onClick={clear}>
Expand All @@ -12,6 +12,12 @@ export function Buttons({ theme, clear, reload }) {
>
Reload
</button>
<button
className={theme === 'dark' ? 'dark-btn' : 'btn'}
onClick={update}
>
update
</button>
</React.Fragment>
)
}
6 changes: 4 additions & 2 deletions src/extension/components/Graphics.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ export function Graphics(props) {
return (
<React.Fragment>
<p>Overall time taken</p>
<canvas id="myChart" width="400" height="300" />
<p>
<div style={{ height: '50vh', width: '100vw', position: 'relative' }}>
<canvas id="myChart" />
</div>
<p style={{ marginTop: '60vh' }}>
{' '}
Total time taken combining all the phases -{' '}
<strong>{props.totalTime} ms</strong>{' '}
Expand Down
46 changes: 43 additions & 3 deletions src/extension/components/Measures.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ const theme = require('../theme')
/**
This component renders the data (measures of each component)
*/

export function Measures(props) {
return (
<div>
<h1 className="component-text">Components</h1>
{props.measures.map((measure, index) => {
return (
<div
key={index}
key={measure.componentName}
id={measure.componentName}
className="container component-result"
>
Expand Down Expand Up @@ -51,11 +52,50 @@ export function Measures(props) {
</td>
</tr>
<tr>
<td>Render (ms)</td>
<td>Cascading Updates (ms)</td>
<td>
<strong>{measure.cascadingUpdate.totalTimeSpentMs}</strong>
</td>
</tr>
<tr>
<td>Cascading Updates (total)</td>
<td>
<strong>{measure.cascadingUpdate.numberOfTimes}</strong>
</td>
</tr>

<tr>
<td> getSnapshotBeforeUpdate (total)</td>
<td>
<strong>
{measure.getSnapshotBeforeUpdate.numberOfTimes}
</strong>
</td>
</tr>

<tr>
<td> getSnapshotBeforeUpdate (ms)</td>
<td>
<strong>{measure.render.totalTimeSpentMs}</strong>
<strong>
{measure.getSnapshotBeforeUpdate.totalTimeSpentMs}
</strong>
</td>
</tr>

<tr>
<td>getChildContext (total)</td>
<td>
<strong>{measure.getChildContext.numberOfTimes}</strong>
</td>
</tr>

<tr>
<td>getChildContext (ma)</td>
<td>
<strong>{measure.getChildContext.totalTimeSpentMs}</strong>
</td>
</tr>

<tr>
<td>Unmount (ms)</td>
<td>
Expand Down
2 changes: 1 addition & 1 deletion src/extension/components/Metrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function Metrics(props) {
<ul className="ctime">
{props.measures.map((measure, index) => {
return (
<li key={index}>
<li key={measure.componentName}>
<ComponentTime
componentname={measure.componentName}
percentage={parseInt(measure.percentTimeSpent)}
Expand Down
Loading