Skip to content

Commit

Permalink
Merge pull request facebook#2219 from pablolmiranda/master
Browse files Browse the repository at this point in the history
Creates a getMeasurementsSummaryMap in ReactDefaultPerf
  • Loading branch information
zpao committed Sep 27, 2014
2 parents a37dcbb + 792b84c commit 3888b97
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/test/ReactDefaultPerf.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,23 @@ var ReactDefaultPerf = {
);
},

printWasted: function(measurements) {
measurements = measurements || ReactDefaultPerf._allMeasurements;
getMeasurementsSummaryMap: function(measurements) {
var summary = ReactDefaultPerfAnalysis.getInclusiveSummary(
measurements,
true
);
console.table(summary.map(function(item) {
return summary.map(function(item) {
return {
'Owner > component': item.componentName,
'Wasted time (ms)': item.time,
'Instances': item.count
};
}));
});
},

printWasted: function(measurements) {
measurements = measurements || ReactDefaultPerf._allMeasurements;
console.table(ReactDefaultPerf.getMeasurementsSummaryMap(measurements));
console.log(
'Total time:',
ReactDefaultPerfAnalysis.getTotalTime(measurements).toFixed(2) + ' ms'
Expand Down

0 comments on commit 3888b97

Please sign in to comment.