Add capacity forecast client method#571
Open
cniackz wants to merge 5 commits intominio:mainfrom
Open
Conversation
klauspost
reviewed
Apr 13, 2026
1a5d6e9 to
805b4f5
Compare
a47844e to
fc0c35f
Compare
bazko1
approved these changes
May 7, 2026
Add struct and client method for the new GET /admin/v4/capacity-forecast endpoint. Returns storage capacity predictions based on historical daily snapshots.
Add MinDaysUntilFull, RSquared, Variance, RecentGrowthRatePerDay, and RecentDaysUntilFull to CapacityForecast struct for Phase 2 of the prediction algorithm.
Expose concrete min/max daily usedFraction deltas so consumers can show the actual extremes alongside the statistical summary.
A -1 sentinel collides with legitimate negative values — e.g. days until 80%% full can legitimately be -5 when usage already crossed the threshold 5 days ago. Use *float64 with nil for "unknown" so the type system represents unset state cleanly. Addresses review feedback from klauspost.
Update struct and field comments to reflect the switch from OLS linear regression to a Kalman filter. No code or type changes.
fc0c35f to
134a0b6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CapacityForecaststruct with storage capacity predictionsCapacityForecast()client method callingGET /admin/v4/capacity-forecastServerInfopatternStruct fields (15)
CurrentUsedBytesuint64CurrentTotalBytesuint64CurrentUsedPercentfloat64DaysUntil80Pct*float64nilif no prediction; may be negative if already pastDaysUntil90Pct*float64DaysUntil100Pct*float64GrowthRatePerDayint64DataPointCountintMinDaysUntilFull*float64nilif no predictionRSquaredfloat64Variancefloat64DayMinDeltafloat64DayMaxDeltafloat64RecentGrowthRatePerDayfloat64RecentDaysUntilFull*float64nilif no prediction)Design notes
*float64(notfloat64with sentinel) sonilcleanly represents "no prediction possible". A concrete value may be negative when the threshold was already crossed in the past — magnitude is meaningful.Related PRs