Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for testMetric (0.43 sec)

  1. pkg/kubelet/kubelet_pods_test.go

    				}
    				drainAllWorkers(podWorkers)
    				tt.wantWorkerAfterRetry(t, podWorkers, processed)
    
    				for k, v := range tt.expectMetricsAfterRetry {
    					testMetric(t, k, v)
    				}
    			}
    		})
    	}
    }
    
    func testMetric(t *testing.T, metricName string, expectedMetric string) {
    	t.Helper()
    	err := testutil.GatherAndCompare(metrics.GetGather(), strings.NewReader(expectedMetric), metricName)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Jun 07 00:05:23 UTC 2024
    - 198.8K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/validation/metrics_test.go

    	Reset() []metrics.Registerable
    }
    
    func TestMetrics(t *testing.T) {
    	featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, apiextensionsfeatures.CRDValidationRatcheting, true)
    
    	// Wrap metric to keep time constant
    	testMetrics := &fakeMetrics{original: validation.Metrics}
    	validation.Metrics = testMetrics
    	defer func() {
    		validation.Metrics = testMetrics.original
    	}()
    
    	metricNames := []string{
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 24 18:25:29 UTC 2024
    - 10.9K bytes
    - Viewed (0)
  3. pkg/registry/core/service/portallocator/allocator_test.go

    	nodePortAvailable.Set(0)
    	nodePortAllocations.Reset()
    	nodePortAllocationErrors.Reset()
    }
    
    type testMetrics struct {
    	free      float64
    	used      float64
    	allocated float64
    	errors    float64
    }
    
    func expectMetrics(t *testing.T, em testMetrics) {
    	var m testMetrics
    	var err error
    	m.free, err = testutil.GetGaugeMetricValue(nodePortAvailable)
    	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)
  4. src/internal/godebug/godebug_test.go

    		t.Setenv("GODEBUG", tt.godebug)
    		got := tt.setting.Value()
    		if got != tt.want {
    			t.Errorf("get(%q, %q) = %q; want %q", tt.godebug, tt.setting.Name(), got, tt.want)
    		}
    	}
    }
    
    func TestMetrics(t *testing.T) {
    	const name = "http2client" // must be a real name so runtime will accept it
    
    	var m [1]metrics.Sample
    	m[0].Name = "/godebug/non-default-behavior/" + name + ":events"
    	metrics.Read(m[:])
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 4K bytes
    - Viewed (0)
  5. pkg/volume/emptydir/empty_dir_test.go

    	if volPath != filepath.Join(basePath, "pods/poduid/volumes/kubernetes.io~empty-dir/vol1") {
    		t.Errorf("Got unexpected path: %s", volPath)
    	}
    }
    
    // TestMetrics tests that MetricProvider methods return sane values.
    func TestMetrics(t *testing.T) {
    	// Create an empty temp directory for the volume
    	tmpDir, err := utiltesting.MkTmpdir("empty_dir_test")
    	if err != nil {
    		t.Fatalf("Can't make a tmp dir: %v", err)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue May 21 10:18:16 UTC 2024
    - 30.7K bytes
    - Viewed (0)
Back to top