@@ -40,31 +40,9 @@ interface BarStackProps {
40
40
hierarchy : any ;
41
41
}
42
42
43
- // function getComponentsArr(componentName, snapshots, node) {
44
- // //Input: Name of component and all snapshots
45
- // //Output: One array of each individual snapshot
46
-
47
- // //NOTE:
48
- // //Every snapshot is an object with a children array with a snapshot that also has a children array etc
49
- // //Children arrays more than one signify siblings
50
-
51
- // }
52
- // // snapshots.map(rootNode => {
53
- // // // rootNode.name
54
- // // let currNode = rootNode
55
- // // while (currNode) {
56
- // // if (currNode.name === componentName) {
57
- // // return currNode.componentData.props
58
- // // } else {
59
- // // currNode = currNode.children[0]
60
- // // currNode = currNode.children[1]
61
- // // }
62
- // // }
63
- // // })
64
43
const makePropsPretty = data => {
65
44
const propsFormat = [ ] ;
66
45
const nestedObj = [ ] ;
67
- // console.log('show me the data we are getting', data);
68
46
if ( typeof data !== 'object' ) {
69
47
return < p > { data } </ p > ;
70
48
}
@@ -81,7 +59,6 @@ const makePropsPretty = data => {
81
59
if ( nestedObj ) {
82
60
propsFormat . push ( nestedObj ) ;
83
61
}
84
- console . log ( 'this is propsformat' , propsFormat ) ;
85
62
return propsFormat ;
86
63
} ;
87
64
@@ -104,7 +81,6 @@ const collectNodes = (snaps, componentName) => {
104
81
} else {
105
82
renderResult . push ( renderTime ) ;
106
83
}
107
- console . log ( 'show me the render time' , renderTime ) ;
108
84
// compare the last pushed component Data from the array to the current one to see if there are differences
109
85
if ( x !== 0 && componentsResult . length !== 0 ) {
110
86
// needs to be stringified because values are hard to determine if true or false if in they're seen as objects
@@ -134,23 +110,18 @@ const collectNodes = (snaps, componentName) => {
134
110
}
135
111
}
136
112
}
137
- // console.log('componentsResult looks like: ', componentsResult);
138
113
139
- // console.log('we should be seeing react components with information', componentsResult);
140
- // componentsResult.push(renderResult);
141
114
const finalResults = componentsResult . map ( ( e , index ) => {
142
115
const name = Object . keys ( e ) [ 0 ] ;
143
- console . log ( 'this is name' , name , 'show me e' , e ) ;
144
116
e [ name ] . rendertime = renderResult [ index ] ;
145
- console . log ( 'this is e' , e ) ;
146
117
return e ;
147
118
} ) ;
148
119
for ( let i = 0 ; i < finalResults . length ; i ++ ) {
149
120
for ( const componentSnapshot in finalResults [ i ] ) {
150
- finalResults [ i ] [ componentSnapshot ] = makePropsPretty ( finalResults [ i ] [ componentSnapshot ] ) ;
121
+ finalResults [ i ] [ componentSnapshot ] = makePropsPretty ( finalResults [ i ] [ componentSnapshot ] ) . reverse ( ) ;
151
122
}
152
123
}
153
- console . log ( 'finalresults ' , finalResults ) ;
124
+ console . log ( 'is this going to reverse ' , finalResults ) ;
154
125
return finalResults ;
155
126
} ;
156
127
@@ -184,13 +155,11 @@ const traverse = (snapshot, data, snapshots, currTotalRender = 0) => {
184
155
}
185
156
// increment render frequencies
186
157
if ( renderTime > 0 ) {
187
- // console.log('what is the child', child);
188
- // console.log('por que?', data.componentData[componentName]);
189
158
data . componentData [ componentName ] . renderFrequency ++ ;
190
- } else {
191
- // console.log('what is the child', child);
192
- // console.log('we dont increment here', data.componentData[componentName], 'and the child', child);
193
159
}
160
+ // else {
161
+
162
+ // }
194
163
195
164
// add to total render time
196
165
data . componentData [ componentName ] . totalRenderTime += renderTime ;
@@ -257,7 +226,6 @@ const PerformanceVisx = (props: BarStackProps) => {
257
226
const [ comparisonData , setComparisonData ] = useState ( ) ;
258
227
const NO_STATE_MSG = 'No state change detected. Trigger an event to change state' ;
259
228
const data = getPerfMetrics ( snapshots , getSnapshotIds ( hierarchy ) ) ;
260
- // console.log('this is line 220', data);
261
229
262
230
const renderComparisonBargraph = ( ) => {
263
231
if ( hierarchy ) {
0 commit comments