Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for GetMetric (0.1 sec)

  1. staging/src/k8s.io/apiserver/pkg/cel/metrics/metrics_test.go

    	metrics, err := legacyregistry.DefaultGatherer.Gather()
    	if err != nil {
    		t.Fatalf("Failed to gather metrics: %s", err)
    	}
    	for _, mf := range metrics {
    		if mf.GetName() == name {
    			for _, m := range mf.GetMetric() {
    				h := m.GetHistogram()
    				count += h.GetSampleCount()
    				sum += h.GetSampleSum()
    			}
    			return
    		}
    	}
    	t.Fatalf("metric not found: %v", name)
    	return 0, 0
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Oct 10 22:05:55 UTC 2022
    - 1.7K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/pkg/util/flowcontrol/metrics/timing_ratio_histogram_test.go

    	if err != nil {
    		return 0, fmt.Errorf("failed to gather metrics: %w", err)
    	}
    	for _, mf := range mfs {
    		thisName := mf.GetName()
    		if thisName != metricName {
    			continue
    		}
    		metric := mf.GetMetric()[0]
    		hist := metric.GetHistogram()
    		if hist == nil {
    			return 0, errors.New("dto.Metric has nil Histogram")
    		}
    		if hist.SampleCount == nil {
    			return 0, errors.New("dto.Histogram has nil SampleCount")
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jul 13 16:03:06 UTC 2022
    - 8.7K bytes
    - Viewed (0)
Back to top