Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ public String toString() {
return Strings.format(
"For data stream %s: %s based on [inc/dec cooldowns %s/%s, %d-%d threads, "
+ "write index %s has all-time/recent/peak loads %g/%g/%g, current shards %d, "
Comment on lines 314 to 315
Copy link
Member

@dakrone dakrone Apr 4, 2025

Choose a reason for hiding this comment

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

This is super minor, so I leave it up to you whether you think it clarifies or not. Feel free to disregard my pedantry :)

When I think of / I think of it as alternative meanings for something (e.g., "my mother/care-taker" being verbalized as "my mother-slash-care-taker"). What do you think of something like:

Suggested change
"For data stream %s: %s based on [inc/dec cooldowns %s/%s, %d-%d threads, "
+ "write index %s has all-time/recent/peak loads %g/%g/%g, current shards %d, "
"For data stream %s: %s based on [inc/dec cooldowns %s/%s, %d-%d threads, "
+ "write index %s has [all-time|recent|peak] loads [%g|%g|%g], current shards %d, "

To clarify that they are corresponding values, instead of potentially implying that the loads are conflated and perhaps mixed?

(I realize the irony of replacing the / with | since | already connotes an "or" meaning, hence why this is so minor and up to you whether to make any changes)

Copy link
Member Author

Choose a reason for hiding this comment

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

See, I'm not sure that I'd find your version more clear!

I don't think that / is only used for alternative meanings. It's also used in dates, for example. If I said that a broadband speed test had a result of 800/500 Mbps for download/upload, would that be confusing?

I think I'm going to respectfully suggest that we've spent enough time on this, we appear to have reached a point where there's a subjective difference on the clearest punctuation without a clear answer, and I'm just going to mash the merge button...

Copy link
Member

Choose a reason for hiding this comment

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

That's totally reasonable! No worries at all, that's part of why I tried to couch it in optional language 😄

+ "using %s value %g for increase gives %d shards%s]",
+ "increase calculation gives %d shards using %s load %g for write index%s]",
inputs.dataStream,
result,
inputs.increaseShardsCooldown,
Expand All @@ -325,19 +325,19 @@ public String toString() {
inputs.writeIndexRecentLoad,
inputs.writeIndexPeakLoad,
inputs.currentNumberOfWriteIndexShards,
increaseCalculation.optimalShardCountForIncrease,
inputs.increaseShardsMetric,
increaseCalculation.writeIndexLoadForIncrease,
increaseCalculation.optimalShardCountForIncrease,
decreaseCalculation == null
? ""
: Strings.format(
", and using %s value %g for dec based on %s gives %d shards",
: String.format(
", decrease calculation gives %d shards using %s load %g for %s",
decreaseCalculation.optimalShardCountForDecrease,
inputs.decreaseShardsMetric,
decreaseCalculation.maxLoadWithinCooldown.load,
decreaseCalculation.maxLoadWithinCooldown.previousIndexWithMaxLoad != null
? decreaseCalculation.maxLoadWithinCooldown.previousIndexWithMaxLoad
: "write index",
decreaseCalculation.optimalShardCountForDecrease
: "write index"
)
);
}
Expand Down