diff --git a/pkg/agent/core/state.go b/pkg/agent/core/state.go index 6ba2bcbfd..e6e9f9f77 100644 --- a/pkg/agent/core/state.go +++ b/pkg/agent/core/state.go @@ -838,15 +838,15 @@ func (s *state) desiredResourcesFromMetricsOrRequestedUpscaling(now time.Time) ( return nil } } - s.updateDesiredClock(now, result, s.VM.Using(), requestedUpscalingAffectedResult) - s.updateCurrentClock(s.VM.CurrentLogicalTime) + s.updateDesiredLogicalTime(now, result, s.VM.Using(), requestedUpscalingAffectedResult) + s.updateCurrentLogicalTime(s.VM.CurrentLogicalTime) s.info("Calculated desired resources", zap.Object("current", s.VM.Using()), zap.Object("target", result)) return result, calculateWaitTime } -func (s *state) updateDesiredClock( +func (s *state) updateDesiredLogicalTime( now time.Time, desired api.Resources, current api.Resources, @@ -866,7 +866,7 @@ func (s *state) updateDesiredClock( s.DesiredLogicalTime = s.ClockSource.Next(now, flags) } -func (s *state) updateCurrentClock(logicalTime *vmv1.LogicalTime) { +func (s *state) updateCurrentLogicalTime(logicalTime *vmv1.LogicalTime) { err := s.ClockSource.Observe(logicalTime) if err != nil { s.warnf("Failed to observe clock source: %v", err) @@ -1178,8 +1178,8 @@ func (s *State) NeonVM() NeonVMHandle { return NeonVMHandle{&s.internal} } -func (s *State) UpdateCurrentClock(logicalTime *vmv1.LogicalTime) { - s.internal.updateCurrentClock(logicalTime) +func (s *State) UpdateCurrentLogicalTime(logicalTime *vmv1.LogicalTime) { + s.internal.updateCurrentLogicalTime(logicalTime) } func (h NeonVMHandle) StartingRequest(now time.Time, resources api.Resources) { diff --git a/pkg/agent/core/state_test.go b/pkg/agent/core/state_test.go index 3ee52345a..0cde6ea4c 100644 --- a/pkg/agent/core/state_test.go +++ b/pkg/agent/core/state_test.go @@ -327,7 +327,7 @@ func TestBasicScaleUpAndDownFlow(t *testing.T) { Wait: &core.ActionWait{Duration: duration("4.8s")}, }) a.Do(state.NeonVM().RequestSuccessful, clock.Now()) - state.UpdateCurrentClock(lt) + state.UpdateCurrentLogicalTime(lt) lt = logicalTime(clock, 6)