Skip to content

Commit

Permalink
Track rollout latency
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan Olshevski committed Dec 13, 2023
1 parent 38a6a34 commit 20c0dd9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions internal/controllers/synthesis/rollout.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,17 @@ func (c *rolloutController) Reconcile(ctx context.Context, req ctrl.Request) (ct

// Update the status to reflect the completed rollout
if syn.Status.CurrentGeneration != syn.Generation {
previousTime := syn.Status.LastRolloutTime
now := metav1.Now()
syn.Status.LastRolloutTime = &now
syn.Status.CurrentGeneration = syn.Generation
if err := c.client.Status().Update(ctx, syn); err != nil {
return ctrl.Result{}, fmt.Errorf("updating synthesizer's current generation: %w", err)
}

// TODO: Add metrics around rollout progress
// TODO: Track rollout latency
if previousTime != nil {
logger = logger.WithValues("latency", now.Sub(previousTime.Time).Milliseconds())
}
if len(compList.Items) > 0 { // log doesn't make sense if the synthesizer wasn't actually rolled out
logger.Info("finished rolling out latest synthesizer version")
}
Expand Down

0 comments on commit 20c0dd9

Please sign in to comment.