Skip to content

Commit

Permalink
feat: improve the debugability during scale teset (#746)
Browse files Browse the repository at this point in the history
* improve the debugability during scale teset

* add missing log

---------

Co-authored-by: Ryan Zhang <zhangryan@microsoft.com>
  • Loading branch information
ryanzhang-oss and Ryan Zhang authored Apr 5, 2024
1 parent 4aeb1ee commit 53ef074
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion cmd/hubagent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
workv1alpha1 "sigs.k8s.io/work-api/pkg/apis/v1alpha1"

fleetnetworkingv1alpha1 "go.goms.io/fleet-networking/api/v1alpha1"

clusterv1beta1 "go.goms.io/fleet/apis/cluster/v1beta1"
placementv1alpha1 "go.goms.io/fleet/apis/placement/v1alpha1"
placementv1beta1 "go.goms.io/fleet/apis/placement/v1beta1"
Expand Down Expand Up @@ -69,7 +70,9 @@ func init() {
// +kubebuilder:scaffold:scheme
klog.InitFlags(nil)

metrics.Registry.MustRegister(fleetmetrics.JoinResultMetrics, fleetmetrics.LeaveResultMetrics, fleetmetrics.PlacementApplyFailedCount, fleetmetrics.PlacementApplySucceedCount)
metrics.Registry.MustRegister(fleetmetrics.JoinResultMetrics, fleetmetrics.LeaveResultMetrics,
fleetmetrics.PlacementApplyFailedCount, fleetmetrics.PlacementApplySucceedCount,
fleetmetrics.SchedulingCycleDurationMilliseconds, fleetmetrics.SchedulerActiveWorkers)
}

func main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ func buildFailedResourcePlacements(work *fleetv1beta1.Work) (isPending bool, res
}

if appliedCond.Status == metav1.ConditionTrue {
klog.V(3).InfoS("The work is applied successfully by the member cluster", "work", workKObj, "workGeneration")
klog.V(3).InfoS("The work is applied successfully by the member cluster", "work", workKObj, "workGeneration", work.GetGeneration())
return false, nil
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/scheduler/framework/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ func (f *framework) runSchedulingCycleForPickNPlacementType(
// longer picked in the current run.
//
// Fields in the returned bindings are fulfilled and/or refreshed as applicable.
klog.V(2).InfoS("Cross-referencing bindings with picked clusters", "clusterSchedulingPolicySnapshot", policyRef)
klog.V(2).InfoS("Cross-referencing bindings with picked clusters", "clusterSchedulingPolicySnapshot", policyRef, "numOfClustersToPick", numOfClustersToPick)
toCreate, toDelete, toPatch, err := crossReferencePickedClustersAndDeDupBindings(crpName, policy, picked, unscheduled, obsolete)
if err != nil {
klog.ErrorS(err, "Failed to cross-reference bindings with picked clusters", "clusterSchedulingPolicySnapshot", policyRef)
Expand Down

0 comments on commit 53ef074

Please sign in to comment.