diff --git a/pkg/es/ilm_forecast.go b/pkg/es/ilm_forecast.go index 9571622..7d73686 100644 --- a/pkg/es/ilm_forecast.go +++ b/pkg/es/ilm_forecast.go @@ -133,6 +133,7 @@ func IlmForecastShow(conf *cfg.Config) error { for _, phase := range phaseData { age := virtualAge(&phase) + if age < phase.age { age = phase.age } @@ -142,7 +143,10 @@ func IlmForecastShow(conf *cfg.Config) error { } } - fmt.Printf("%s bytes of data will be rolled within %s\n", humanize.Bytes(uint64(toBeFreed)), within) + fmt.Printf("%s bytes of data in %s phase will be rolled within %s to the next phase\n", + humanize.Bytes(uint64(toBeFreed)), + conf.Ilm.FromPhase, + within) return nil } @@ -152,13 +156,7 @@ func virtualAge(phase *PhaseData) time.Duration { return time.Duration(0) } - oneMinAge := phase.minage.Seconds() / 100 - oneMinSize := float64(phase.minsize) / 100 - - percentSize := float64(phase.size) / oneMinSize - virtualAge := percentSize * oneMinAge - - return time.Duration(virtualAge) * time.Second + return phase.minage * time.Duration(100*phase.size/phase.minsize) / 100 } // Retrieve all index, ilm-explain and ilm-policies in parallel