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

Better HTML report model #254

Merged
merged 24 commits into from
Sep 14, 2020
Merged

Better HTML report model #254

merged 24 commits into from
Sep 14, 2020

Conversation

lptr
Copy link
Member

@lptr lptr commented Sep 14, 2020

Vue.js allows us to better model things. Let's make use of it.

test-report.html.zip

@lptr lptr added enhancement internal Internal change labels Sep 14, 2020
@lptr lptr self-assigned this Sep 14, 2020
@lptr lptr marked this pull request as ready for review September 14, 2020 13:50
@lptr lptr requested a review from wolfs September 14, 2020 14:14
@lptr lptr added this to the 0.15.0 milestone Sep 14, 2020
Copy link
Member

@wolfs wolfs left a comment

Choose a reason for hiding this comment

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

Nice! I added some comments.

// Initialize sample config
benchmarkResult.scenarios.forEach((scenario, scenarioIndex, scenarios) => {
scenario.samples.forEach((sample, sampleIndex, samples) => {
sample.color = `hsl(${scenarioIndex * 360 / scenarios.length}, ${100 - 80 * sampleIndex / samples.length}%, ${30 + 40 * sampleIndex / samples.length}%)`;
Copy link
Member

Choose a reason for hiding this comment

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

I find the shades of red/green very hard to distinguish:
image

Do you have any better ideas what colors to use?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure how important it is to distinguish the different shades of green (=different build operations for the same experiment), it seems more important to distinguish the green from the red (same build operations for different experiments).

Copy link
Member Author

Choose a reason for hiding this comment

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

That said I'm open to suggestions.

let maxMeasuredIterations = Math.max(...(benchmarkResult.scenarios.map(scenario => iterations(scenario, Phase.MEASURE).length)));
let chart = new Chart(ctx, {
type: 'line',
var app = new Vue({
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
var app = new Vue({
const app = new Vue({

No need to leave this mutable.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've fixed this and others.

@@ -148,12 +142,21 @@
</div>
</div>
<footer>
<span>Gradle Profiler version {{ environment.profilerVersion }}</span>
<span>Gradle Profiler version {{ benchmarkResult.environment.profilerVersion }}</span>
</footer>
</div>
<script>
Array.prototype.unique = function() { return [...new Set(this)]; };
Copy link
Member

Choose a reason for hiding this comment

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

The unique function is now unused.

Copy link
Member Author

Choose a reason for hiding this comment

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

I removed it and moved the utility functions into Array prototype functions.

}
}
};

function convertScenarioToChart(scenario, sample, sorted, color) {
var data = iterations(scenario, Phase.MEASURE)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
var data = iterations(scenario, Phase.MEASURE)
const data = iterations(scenario, Phase.MEASURE)

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@lptr lptr requested a review from wolfs September 14, 2020 16:26
Copy link
Member

@wolfs wolfs left a comment

Choose a reason for hiding this comment

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

LGTM! I still wonder if we can do something about the colors. Let's merge this PR and discuss to see if we can come up with something.

@lptr lptr merged commit bd5efe2 into master Sep 14, 2020
@lptr lptr deleted the lptr/better-model-in-html branch September 14, 2020 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants