-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathMeasures.js
More file actions
161 lines (152 loc) · 4.75 KB
/
Measures.js
File metadata and controls
161 lines (152 loc) · 4.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
import React from 'react'
import { ProgressLoader } from './ProgressLoader'
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={measure.componentName}
id={measure.componentName}
className="container component-result"
>
<h2>{measure.componentName}</h2>
<table style={theme === 'dark' ? { color: '#eff1f4' } : null}>
<tr>
<td>Total time (ms)</td>
<td>
<strong>{Number(measure.totalTimeSpent.toFixed(2))}</strong>
</td>
</tr>
<tr>
<td>Instances</td>
<td>
<strong>{measure.numberOfInstances}</strong>
</td>
</tr>
<tr>
<td>Total time (%)</td>
<td>
<strong>{measure.percentTimeSpent}</strong>
</td>
</tr>
<tr>
<td>Mount (ms)</td>
<td>
<strong>{measure.mount.totalTimeSpentMs}</strong>
</td>
</tr>
<tr>
<td>Update (ms)</td>
<td>
<strong>{measure.update.totalTimeSpentMs}</strong>
</td>
</tr>
<tr>
<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.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>
<strong>{measure.unmount.totalTimeSpentMs}</strong>
</td>
</tr>
<tr>
<td>componentWillMount (ms)</td>
<td>
<strong>{measure.componentWillMount.totalTimeSpentMs}</strong>
</td>
</tr>
<tr>
<td>componentDidMount (ms)</td>
<td>
<strong>{measure.componentDidMount.totalTimeSpentMs}</strong>
</td>
</tr>
<tr>
<td>componentWillReceiveProps (ms)</td>
<td>
<strong>
{measure.componentWillReceiveProps.totalTimeSpentMs}
</strong>
</td>
</tr>
<tr>
<td>shouldComponentUpdate (ms)</td>
<td>
<strong>
{measure.shouldComponentUpdate.totalTimeSpentMs}
</strong>
</td>
</tr>
<tr>
<td>componentWillUpdate (ms)</td>
<td>
<strong>
{measure.componentWillUpdate.totalTimeSpentMs}
</strong>
</td>
</tr>
<tr>
<td>componentDidUpdate (ms)</td>
<td>
<strong>{measure.componentDidUpdate.totalTimeSpentMs}</strong>
</td>
</tr>
<tr>
<td>componentWillUnmount (ms)</td>
<td>
<strong>
{measure.componentWillUnmount.totalTimeSpentMs}
</strong>
</td>
</tr>
</table>
</div>
)
})}
</div>
)
}