Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for clearMetrics (0.15 sec)

  1. pkg/kubelet/util/node_startup_latency_tracker_test.go

    )
    
    func TestNodeStartupLatencyNoEvents(t *testing.T) {
    	t.Run("metrics registered; no incoming events", func(t *testing.T) {
    		metrics.Register()
    		defer clearMetrics()
    
    		tracker := &basicNodeStartupLatencyTracker{
    			bootTime:         frozenTime.Add(-100 * time.Millisecond),
    			kubeletStartTime: frozenTime,
    			clock:            clock.RealClock{},
    		}
    
    		wants := `
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Sep 11 05:54:25 UTC 2023
    - 18K bytes
    - Viewed (0)
  2. pkg/kubelet/metrics/metrics_test.go

    )
    
    const imagePullDurationKey = "kubelet_" + ImagePullDurationKey
    
    func TestImagePullDurationMetric(t *testing.T) {
    	t.Run("register image pull duration", func(t *testing.T) {
    		Register()
    		defer clearMetrics()
    
    		// Pairs of image size in bytes and pull duration in seconds
    		dataPoints := [][]float64{
    			// 0 byets, 0 seconds
    			{0, 0},
    			// 5MB, 10 seconds
    			{5 * 1024 * 1024, 10},
    			// 15MB, 20 seconds
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Feb 08 00:30:31 UTC 2024
    - 1.9K bytes
    - Viewed (0)
  3. pkg/registry/core/service/portallocator/controller/repair_test.go

    	return r.item, r.err
    }
    
    func (r *mockRangeRegistry) CreateOrUpdate(alloc *api.RangeAllocation) error {
    	r.updateCalled = true
    	r.updated = alloc
    	return r.updateErr
    }
    
    func TestRepair(t *testing.T) {
    	clearMetrics()
    	fakeClient := fake.NewSimpleClientset()
    	registry := &mockRangeRegistry{
    		item: &api.RangeAllocation{Range: "100-200"},
    	}
    	pr, _ := net.ParsePortRange(registry.item.Range)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Sep 30 15:46:06 UTC 2023
    - 10.6K bytes
    - Viewed (0)
  4. pkg/registry/core/service/ipallocator/controller/repair_test.go

    	if err := r.runOnce(); !strings.Contains(err.Error(), ": test error") {
    		t.Fatal(err)
    	}
    }
    
    func TestRepairLeak(t *testing.T) {
    	clearMetrics()
    
    	_, cidr, _ := netutils.ParseCIDRSloppy("192.168.1.0/24")
    	previous, err := ipallocator.NewInMemory(cidr)
    	if err != nil {
    		t.Fatal(err)
    	}
    	previous.Allocate(netutils.ParseIPSloppy("192.168.1.10"))
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Sep 30 15:46:06 UTC 2023
    - 21.1K bytes
    - Viewed (0)
  5. pkg/registry/core/service/portallocator/allocator_test.go

    			if got := calculateRangeOffset(tt.args.pr); got != tt.want {
    				t.Errorf("calculateRangeOffset() = %v, want %v", got, tt.want)
    			}
    		})
    	}
    }
    
    func TestNodePortMetrics(t *testing.T) {
    	clearMetrics()
    	// create node port allocator
    	portRange := "30000-32767"
    	pr, err := net.ParsePortRange(portRange)
    	if err != nil {
    		t.Fatal(err)
    	}
    
    	a, err := NewInMemory(*pr)
    	if err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 08 07:15:02 UTC 2024
    - 14K bytes
    - Viewed (0)
  6. pkg/controller/nodeipam/ipam/cidrset/cidr_set_test.go

    				}
    			}
    		})
    	}
    }
    
    func TestCidrSetMetrics(t *testing.T) {
    	cidr := "10.0.0.0/16"
    	_, clusterCIDR, _ := netutils.ParseCIDRSloppy(cidr)
    	clearMetrics(map[string]string{"clusterCIDR": cidr})
    
    	// We have 256 free cidrs
    	a, err := NewCIDRSet(clusterCIDR, 24)
    	if err != nil {
    		t.Fatalf("unexpected error creating CidrSet: %v", err)
    	}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu May 11 08:53:03 UTC 2023
    - 29.5K bytes
    - Viewed (0)
  7. pkg/registry/core/service/ipallocator/bitmap_test.go

    	}
    
    	for _, ip := range allocated {
    		if !r.Has(ip) {
    			t.Fatalf("expected IP to be allocated, but it was not")
    		}
    	}
    }
    
    func TestClusterIPMetrics(t *testing.T) {
    	clearMetrics()
    	// create IPv4 allocator
    	cidrIPv4 := "10.0.0.0/24"
    	_, clusterCIDRv4, _ := netutils.ParseCIDRSloppy(cidrIPv4)
    	a, err := NewInMemory(clusterCIDRv4)
    	if err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jan 25 20:32:40 UTC 2023
    - 21.1K bytes
    - Viewed (0)
  8. pkg/registry/core/service/ipallocator/ipallocator_test.go

    		}
    		if !calls.Equal(tc) {
    			t.Errorf("[%d] expected calls to equal testcase: %v vs %v", i, calls.List(), tc.List())
    		}
    	}
    }
    
    func TestIPAllocatorClusterIPMetrics(t *testing.T) {
    	clearMetrics()
    	// create IPv4 allocator
    	cidrIPv4 := "10.0.0.0/24"
    	_, clusterCIDRv4, _ := netutils.ParseCIDRSloppy(cidrIPv4)
    	a, err := newTestAllocator(clusterCIDRv4)
    	if err != nil {
    		t.Fatal(err)
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sun Jun 25 13:14:46 UTC 2023
    - 24.2K bytes
    - Viewed (0)
Back to top