@@ -599,11 +599,11 @@ var _ = Describe("RouteRegistry", func() {
599599 r .Register ("hb.example.com" , hbEndpoint )
600600
601601 captureCount := reporter .CaptureEndpointsPerPoolCallCount ()
602- deleteCount := reporter .DeleteEndpointsPerPoolCallCount ()
602+ deleteCount := reporter .UncaptureEndpointsPerPoolCallCount ()
603603
604604 // The metric should be captured but NOT deleted for an active HB route
605605 Expect (captureCount ).To (Equal (1 ))
606- Expect (deleteCount ).To (Equal (0 ), "DeleteEndpointsPerPool should not be called when registering an HB endpoint with a live pool" )
606+ Expect (deleteCount ).To (Equal (0 ), "UncaptureEndpointsPerPool should not be called when registering an HB endpoint with a live pool" )
607607 })
608608
609609 It ("does not report the metric for non-HB endpoints" , func () {
@@ -631,9 +631,9 @@ var _ = Describe("RouteRegistry", func() {
631631
632632 r .Unregister ("hb.example.com" , hbEndpoint )
633633 // After unregistering the last endpoint, the metric should be deleted
634- Expect (reporter .DeleteEndpointsPerPoolCallCount ()).To (BeNumerically (">=" , 1 ))
635- lastCall := reporter .DeleteEndpointsPerPoolCallCount () - 1
636- uri , algo := reporter .DeleteEndpointsPerPoolArgsForCall (lastCall )
634+ Expect (reporter .UncaptureEndpointsPerPoolCallCount ()).To (BeNumerically (">=" , 1 ))
635+ lastCall := reporter .UncaptureEndpointsPerPoolCallCount () - 1
636+ uri , algo := reporter .UncaptureEndpointsPerPoolArgsForCall (lastCall )
637637 Expect (uri ).To (Equal ("hb.example.com" ))
638638 Expect (algo ).To (Equal (config .LOAD_BALANCE_HB ))
639639 })
@@ -682,20 +682,20 @@ var _ = Describe("RouteRegistry", func() {
682682 LoadBalancingAlgorithm : config .LOAD_BALANCE_RR ,
683683 })
684684
685- deleteBefore := reporter .DeleteEndpointsPerPoolCallCount ()
685+ deleteBefore := reporter .UncaptureEndpointsPerPoolCallCount ()
686686 r .Register ("switching.example.com" , rrEndpoint )
687687
688688 // Should have called delete to clean up the stale HB metric
689- Expect (reporter .DeleteEndpointsPerPoolCallCount ()).To (BeNumerically (">" , deleteBefore ))
689+ Expect (reporter .UncaptureEndpointsPerPoolCallCount ()).To (BeNumerically (">" , deleteBefore ))
690690 found := false
691- for i := deleteBefore ; i < reporter .DeleteEndpointsPerPoolCallCount (); i ++ {
692- uri , algo := reporter .DeleteEndpointsPerPoolArgsForCall (i )
691+ for i := deleteBefore ; i < reporter .UncaptureEndpointsPerPoolCallCount (); i ++ {
692+ uri , algo := reporter .UncaptureEndpointsPerPoolArgsForCall (i )
693693 if uri == "switching.example.com" && algo == config .LOAD_BALANCE_HB {
694694 found = true
695695 break
696696 }
697697 }
698- Expect (found ).To (BeTrue (), "expected DeleteEndpointsPerPool to be called for the switched route" )
698+ Expect (found ).To (BeTrue (), "expected UncaptureEndpointsPerPool to be called for the switched route" )
699699 })
700700
701701 It ("deletes the HB metric when the HB algorithm is removed and endpoint registers with empty algorithm" , func () {
@@ -717,19 +717,19 @@ var _ = Describe("RouteRegistry", func() {
717717 LoadBalancingAlgorithm : "" ,
718718 })
719719
720- deleteBefore := reporter .DeleteEndpointsPerPoolCallCount ()
720+ deleteBefore := reporter .UncaptureEndpointsPerPoolCallCount ()
721721 r .Register ("removed-hb.example.com" , noAlgoEndpoint )
722722
723- Expect (reporter .DeleteEndpointsPerPoolCallCount ()).To (BeNumerically (">" , deleteBefore ))
723+ Expect (reporter .UncaptureEndpointsPerPoolCallCount ()).To (BeNumerically (">" , deleteBefore ))
724724 found := false
725- for i := deleteBefore ; i < reporter .DeleteEndpointsPerPoolCallCount (); i ++ {
726- uri , algo := reporter .DeleteEndpointsPerPoolArgsForCall (i )
725+ for i := deleteBefore ; i < reporter .UncaptureEndpointsPerPoolCallCount (); i ++ {
726+ uri , algo := reporter .UncaptureEndpointsPerPoolArgsForCall (i )
727727 if uri == "removed-hb.example.com" && algo == config .LOAD_BALANCE_HB {
728728 found = true
729729 break
730730 }
731731 }
732- Expect (found ).To (BeTrue (), "expected DeleteEndpointsPerPool to be called when HB algorithm is removed" )
732+ Expect (found ).To (BeTrue (), "expected UncaptureEndpointsPerPool to be called when HB algorithm is removed" )
733733 })
734734
735735 It ("does not change the metric count when an existing HB endpoint is updated" , func () {
@@ -763,10 +763,10 @@ var _ = Describe("RouteRegistry", func() {
763763
764764 It ("deletes the metric when HB endpoints are pruned" , func () {
765765 hbEndpoint := route .NewEndpoint (& route.EndpointOpts {
766- Host : "192.168.1.1" ,
767- Port : 8080 ,
768- PrivateInstanceId : "id-hb-1" ,
769- LoadBalancingAlgorithm : config .LOAD_BALANCE_HB ,
766+ Host : "192.168.1.1" ,
767+ Port : 8080 ,
768+ PrivateInstanceId : "id-hb-1" ,
769+ LoadBalancingAlgorithm : config .LOAD_BALANCE_HB ,
770770 StaleThresholdInSeconds : int (configObj .DropletStaleThreshold .Seconds ()),
771771 })
772772
@@ -778,18 +778,18 @@ var _ = Describe("RouteRegistry", func() {
778778
779779 // Wait for the endpoint to go stale and be pruned
780780 Eventually (func () int {
781- return reporter .DeleteEndpointsPerPoolCallCount ()
781+ return reporter .UncaptureEndpointsPerPoolCallCount ()
782782 }, configObj .PruneStaleDropletsInterval + configObj .DropletStaleThreshold + 100 * time .Millisecond ).Should (BeNumerically (">=" , 1 ))
783783
784784 found := false
785- for i := 0 ; i < reporter .DeleteEndpointsPerPoolCallCount (); i ++ {
786- uri , algo := reporter .DeleteEndpointsPerPoolArgsForCall (i )
785+ for i := 0 ; i < reporter .UncaptureEndpointsPerPoolCallCount (); i ++ {
786+ uri , algo := reporter .UncaptureEndpointsPerPoolArgsForCall (i )
787787 if uri == "hb-prune.example.com" && algo == config .LOAD_BALANCE_HB {
788788 found = true
789789 break
790790 }
791791 }
792- Expect (found ).To (BeTrue (), "expected DeleteEndpointsPerPool to be called when HB endpoints are pruned" )
792+ Expect (found ).To (BeTrue (), "expected UncaptureEndpointsPerPool to be called when HB endpoints are pruned" )
793793 })
794794
795795 It ("updates the metric when some HB endpoints are pruned but others remain" , func () {
0 commit comments