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

fix: readability improvements to artifact size metrics #41

Merged
merged 3 commits into from
May 1, 2024

Conversation

0marperez
Copy link
Contributor

Issue #, if available:
N/A

Description of changes:
Readability improvements to the artifact size metrics comment/table(s)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@0marperez
Copy link
Contributor Author

0marperez commented Apr 30, 2024

The new format for the comments:

Affected Artifacts

Significantly increased in size

Artifact Pull Request (bytes) Latest Release (bytes) Delta (bytes) Delta (percentage)
lexruntimeservice-jvm.jar closure 9,641,031 8,641,031 1,000,000 11.57%
Changed in size
Artifact Pull Request (bytes) Latest Release (bytes) Delta (bytes) Delta (percentage)
resourcegroupstaggingapi-jvm.jar closure 8,607,387 8,607,377 10 0.00%

@0marperez 0marperez marked this pull request as ready for review April 30, 2024 16:43
@@ -109,34 +110,73 @@ internal abstract class AnalyzeArtifactSizeMetrics : DefaultTask() {
return ArtifactSizeMetricsAnalysis(artifactSizeMetrics, significantChange, changeHappened)
}

// There are small fluctuations in artifact size that are not real delta
private fun Long.isNotaFluctuation() = abs(this) > 5L
Copy link
Member

Choose a reason for hiding this comment

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

question: Is this number big enough? In your example comment, there was a delta of 10 bytes that also seems like a fluctuation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm basing it off the fluctuations seen here: awslabs/aws-sdk-kotlin#1291. They're all less than 5. That 10 I added manually but I'm not opposed to upping the threshold

Copy link
Member

Choose a reason for hiding this comment

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

Ah ok, that seems fine then. I didn't realize the 10 was a manual data point

Copy link
Contributor

Choose a reason for hiding this comment

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

If we're hiding the unimportant/no-action-required changes by default, do we still need to filter out these fluctuations?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not really necessary but I also wouldn't consider it real delta

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It pollutes an already large table

@@ -109,34 +110,73 @@ internal abstract class AnalyzeArtifactSizeMetrics : DefaultTask() {
return ArtifactSizeMetricsAnalysis(artifactSizeMetrics, significantChange, changeHappened)
}

// There are small fluctuations in artifact size that are not real delta
private fun Long.isNotaFluctuation() = abs(this) > 5L
Copy link
Contributor

Choose a reason for hiding this comment

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

If we're hiding the unimportant/no-action-required changes by default, do we still need to filter out these fluctuations?

Comment on lines 152 to 156
append("|")
append("%.2f".format(metric.value.percentage))
append("%")
if (metric.value.requiresAttention()) append("⚠️")
appendLine("|")
Copy link
Contributor

Choose a reason for hiding this comment

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

Question: Is the ⚠️ necessary now that there are two tables? Won't every entry in the Significantly increased in size table have the ⚠️ next to it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I think it looks good but I also see how it can be an eye sore. I'm open to getting rid of it

Copy link
Member

Choose a reason for hiding this comment

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

I think it's just redundant information, I support removing it


analysis.metrics
.toList()
.sortedBy { it.second.percentage }.toMap()
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: This sorts in ascending order but I think we probably want descending order.

Style: When using fluent call patterns, put each chained property access and method call on its own line.

analysis
    .metrics
    .toList()
    .sortedByDescending { it.second.percentage }
    .toMap()
    .forEach { metric ->

@awslabs awslabs deleted a comment from 0marperez May 1, 2024
@awslabs awslabs deleted a comment from 0marperez May 1, 2024
@0marperez 0marperez merged commit 72ac3f7 into main May 1, 2024
5 checks passed
@0marperez 0marperez deleted the asm-improvements branch May 1, 2024 16:01
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.

3 participants