Skip to content

Commit

Permalink
couple of renames
Browse files Browse the repository at this point in the history
Signed-off-by: Oleg Vasilev <[email protected]>
  • Loading branch information
Omrigan committed Jul 8, 2024
1 parent 63c9086 commit 4ac9099
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions pkg/agent/core/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/agent/core/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 4ac9099

Please sign in to comment.