mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 16:14:17 +02:00
optimzie virtualAge() a little
This commit is contained in:
@@ -133,6 +133,7 @@ func IlmForecastShow(conf *cfg.Config) error {
|
|||||||
|
|
||||||
for _, phase := range phaseData {
|
for _, phase := range phaseData {
|
||||||
age := virtualAge(&phase)
|
age := virtualAge(&phase)
|
||||||
|
|
||||||
if age < phase.age {
|
if age < phase.age {
|
||||||
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
|
return nil
|
||||||
}
|
}
|
||||||
@@ -152,13 +156,7 @@ func virtualAge(phase *PhaseData) time.Duration {
|
|||||||
return time.Duration(0)
|
return time.Duration(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
oneMinAge := phase.minage.Seconds() / 100
|
return phase.minage * time.Duration(100*phase.size/phase.minsize) / 100
|
||||||
oneMinSize := float64(phase.minsize) / 100
|
|
||||||
|
|
||||||
percentSize := float64(phase.size) / oneMinSize
|
|
||||||
virtualAge := percentSize * oneMinAge
|
|
||||||
|
|
||||||
return time.Duration(virtualAge) * time.Second
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Retrieve all index, ilm-explain and ilm-policies in parallel
|
// Retrieve all index, ilm-explain and ilm-policies in parallel
|
||||||
|
|||||||
Reference in New Issue
Block a user