Skip to content

Commit 592a79c

Browse files
authored
Merge pull request kubernetes#90972 from squeed/proxy-last-queued-metric
proxy: followup to last-queued-change metric
2 parents 006ecee + 042daa2 commit 592a79c

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

pkg/proxy/iptables/proxier.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,8 +504,8 @@ func (proxier *Proxier) probability(n int) string {
504504
func (proxier *Proxier) Sync() {
505505
if proxier.healthzServer != nil {
506506
proxier.healthzServer.QueuedUpdate()
507-
metrics.SyncProxyRulesLastQueuedTimestamp.SetToCurrentTime()
508507
}
508+
metrics.SyncProxyRulesLastQueuedTimestamp.SetToCurrentTime()
509509
proxier.syncRunner.Run()
510510
}
511511

@@ -515,6 +515,9 @@ func (proxier *Proxier) SyncLoop() {
515515
if proxier.healthzServer != nil {
516516
proxier.healthzServer.Updated()
517517
}
518+
519+
// synthesize "last change queued" time as the informers are syncing.
520+
metrics.SyncProxyRulesLastQueuedTimestamp.SetToCurrentTime()
518521
proxier.syncRunner.Loop(wait.NeverStop)
519522
}
520523

pkg/proxy/ipvs/proxier.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,8 +810,8 @@ func CleanupLeftovers(ipvs utilipvs.Interface, ipt utiliptables.Interface, ipset
810810
func (proxier *Proxier) Sync() {
811811
if proxier.healthzServer != nil {
812812
proxier.healthzServer.QueuedUpdate()
813-
metrics.SyncProxyRulesLastQueuedTimestamp.SetToCurrentTime()
814813
}
814+
metrics.SyncProxyRulesLastQueuedTimestamp.SetToCurrentTime()
815815
proxier.syncRunner.Run()
816816
}
817817

@@ -821,6 +821,8 @@ func (proxier *Proxier) SyncLoop() {
821821
if proxier.healthzServer != nil {
822822
proxier.healthzServer.Updated()
823823
}
824+
// synthesize "last change queued" time as the informers are syncing.
825+
metrics.SyncProxyRulesLastQueuedTimestamp.SetToCurrentTime()
824826
proxier.syncRunner.Loop(wait.NeverStop)
825827
}
826828

pkg/proxy/winkernel/proxier.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import (
3434
"github.com/davecgh/go-spew/spew"
3535
"k8s.io/klog"
3636

37-
"k8s.io/api/core/v1"
37+
v1 "k8s.io/api/core/v1"
3838
"k8s.io/apimachinery/pkg/types"
3939
"k8s.io/apimachinery/pkg/util/intstr"
4040
"k8s.io/apimachinery/pkg/util/sets"
@@ -736,8 +736,8 @@ func getHnsNetworkInfo(hnsNetworkName string) (*hnsNetworkInfo, error) {
736736
func (proxier *Proxier) Sync() {
737737
if proxier.healthzServer != nil {
738738
proxier.healthzServer.QueuedUpdate()
739-
metrics.SyncProxyRulesLastQueuedTimestamp.SetToCurrentTime()
740739
}
740+
metrics.SyncProxyRulesLastQueuedTimestamp.SetToCurrentTime()
741741
proxier.syncRunner.Run()
742742
}
743743

@@ -747,6 +747,8 @@ func (proxier *Proxier) SyncLoop() {
747747
if proxier.healthzServer != nil {
748748
proxier.healthzServer.Updated()
749749
}
750+
// synthesize "last change queued" time as the informers are syncing.
751+
metrics.SyncProxyRulesLastQueuedTimestamp.SetToCurrentTime()
750752
proxier.syncRunner.Loop(wait.NeverStop)
751753
}
752754

0 commit comments

Comments
 (0)