-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Adds Cluster Balance Stats Tests #132936
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
Adds Cluster Balance Stats Tests #132936
Conversation
Adds serialization tests for `ClusterBalanceStats.MetricStats` and `ClusterBalanceStats.TierBalanceStats`
|
Pinging @elastic/es-distributed-coordination (Team:Distributed Coordination) |
…-1/elasticsearch into cluster-balance-stats-tests
|
I added these tests during #131025 but didn't commit them to avoid bloating the PR. Adding them now as they're useful |
ywangd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| double total = randomDouble(); | ||
| double min = randomDouble(); | ||
| double max = randomDouble(); | ||
| double average = randomDouble(); | ||
| double stdDev = randomDouble(); | ||
| ClusterBalanceStats.MetricStats stats = new ClusterBalanceStats.MetricStats(total, min, max, average, stdDev); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I think these can be replaced by calling createRandomMetricStats() and the later assertions can compare with stats.total() etc?
| ClusterBalanceStats.MetricStats shardCount = createRandomMetricStats(); | ||
| ClusterBalanceStats.MetricStats undesiredShardAllocations = createRandomMetricStats(); | ||
| ClusterBalanceStats.MetricStats forecastWriteLoad = createRandomMetricStats(); | ||
| ClusterBalanceStats.MetricStats forecastDiskUsage = createRandomMetricStats(); | ||
| ClusterBalanceStats.MetricStats actualDiskUsage = createRandomMetricStats(); | ||
| ClusterBalanceStats.TierBalanceStats tierBalanceStats = new ClusterBalanceStats.TierBalanceStats( | ||
| shardCount, | ||
| undesiredShardAllocations, | ||
| forecastWriteLoad, | ||
| forecastDiskUsage, | ||
| actualDiskUsage | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar nit: this can be replaced by createRandomTierBalanceStats()?
Adds serialization tests for `ClusterBalanceStats.MetricStats` and `ClusterBalanceStats.TierBalanceStats`
Adds serialization tests for
MetricStatsTestsandTierBalanceStatsTestsRelated to #131025