Merge pull request #2809 from hashicorp/f-scheduling-logs
Basic logs from reconciler
This commit is contained in:
commit
e9f5339f69
|
@ -5039,6 +5039,11 @@ type DesiredUpdates struct {
|
|||
Canary uint64
|
||||
}
|
||||
|
||||
func (d *DesiredUpdates) GoString() string {
|
||||
return fmt.Sprintf("(place %d) (inplace %d) (destructive %d) (stop %d) (migrate %d) (ignore %d) (canary %d)",
|
||||
d.Place, d.InPlaceUpdate, d.DestructiveUpdate, d.Stop, d.Migrate, d.Ignore, d.Canary)
|
||||
}
|
||||
|
||||
// msgpackHandle is a shared handle for encoding/decoding of structs
|
||||
var MsgpackHandle = func() *codec.MsgpackHandle {
|
||||
h := &codec.MsgpackHandle{RawToString: true}
|
||||
|
|
|
@ -389,6 +389,7 @@ func (s *GenericScheduler) computeJobAllocs() error {
|
|||
genericAllocUpdateFn(s.ctx, s.stack, s.eval.ID),
|
||||
s.batch, s.eval.JobID, s.job, s.deployment, allocs, tainted)
|
||||
results := reconciler.Compute()
|
||||
s.logger.Printf("[DEBUG] sched: %#v: %#v", s.eval, results)
|
||||
|
||||
if s.eval.AnnotatePlan {
|
||||
s.plan.Annotations = &structs.PlanAnnotations{
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package scheduler
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"time"
|
||||
|
||||
|
@ -107,6 +108,26 @@ type allocStopResult struct {
|
|||
statusDescription string
|
||||
}
|
||||
|
||||
func (r *reconcileResults) GoString() string {
|
||||
base := fmt.Sprintf("Total changes: (place %d) (update %d) (stop %d)",
|
||||
len(r.place), len(r.inplaceUpdate), len(r.stop))
|
||||
|
||||
if r.deployment != nil {
|
||||
base += fmt.Sprintf("\nCreated Deployment: %q", r.deployment.ID)
|
||||
}
|
||||
for _, u := range r.deploymentUpdates {
|
||||
base += fmt.Sprintf("\nDeployment Update for ID %q: Status %q; Description %q",
|
||||
u.DeploymentID, u.Status, u.StatusDescription)
|
||||
}
|
||||
if r.followupEvalWait != 0 {
|
||||
base += fmt.Sprintf("\nFollowup Eval in %v", r.followupEvalWait)
|
||||
}
|
||||
for tg, u := range r.desiredTGUpdates {
|
||||
base += fmt.Sprintf("\nDesired Changes for %q: %#v", tg, u)
|
||||
}
|
||||
return base
|
||||
}
|
||||
|
||||
// Changes returns the number of total changes
|
||||
func (r *reconcileResults) Changes() int {
|
||||
return len(r.place) + len(r.inplaceUpdate) + len(r.stop)
|
||||
|
|
Loading…
Reference in a new issue