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

Creates a getMeasurementsSummaryMap in ReactDefaultPerf #2219

Merged
merged 2 commits into from
Sep 27, 2014

Conversation

pablolmiranda
Copy link

=== Problem
ReactDefaultPerf has a printWasted function that uses console.table to show the results of the performance measurements.
PhantomJS doesn't have the console.table function, so it's hard to get the metrics and present them in a CI pipeline.

=== Solution
Create a ReactDefaultPerf.getMeasurementsSummaryMap that receives a set of measurements and just generate the summary map.
This solution make possible to get the performance summary and format them as you like. Even using console.log().

// very simple example
console.log(
    Perf.getMeasurementsSummaryMap(Perf.getLastMeasurements())
);

@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at [email protected]. Thanks!

@pablolmiranda
Copy link
Author

CLA signed.

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@zpao
Copy link
Member

zpao commented Sep 23, 2014

cc @petehunt @joshduck

@joshduck
Copy link
Contributor

Is it possible to call ReactDefaultPerfAnalysis.getInclusiveSummary directly in your CI pipeline?

@pablolmiranda
Copy link
Author

It's not because we are bundling everything for functional test.
We could we maintain one fork publishing the ReactDefaultPerfAnalysis.getInclusiveSummary in the addons public interface. But I would not like to diverge from the main repo.
There is reason for not expose a proxy to the performance analysis summary?

@@ -90,19 +90,23 @@ var ReactDefaultPerf = {
);
},

printWasted: function(measurements) {
measurements = measurements || ReactDefaultPerf._allMeasurements;
getMeasurementsSummaryMap: function(measurements){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space before the curly brace.

zpao added a commit that referenced this pull request Sep 27, 2014
Creates a getMeasurementsSummaryMap in ReactDefaultPerf
@zpao zpao merged commit 3888b97 into facebook:master Sep 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants