Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 35 for getMetrics (0.11 sec)

  1. pkg/volume/metrics_du_test.go

    	}
    	actual, err = metrics.GetMetrics()
    	if err != nil {
    		t.Errorf("Unexpected error when calling GetMetrics %v", err)
    	}
    	if e, a := previousInodes, actual.InodesUsed.Value(); e != a {
    		t.Errorf("Unexpected Used for directory with file.  Expected %v, got %d.", e, a)
    	}
    
    }
    
    // TestMetricsDuRequireInit tests that if MetricsDu is not initialized with a path, GetMetrics
    // returns an error
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jun 20 14:49:03 UTC 2023
    - 3.9K bytes
    - Viewed (0)
  2. pkg/volume/metrics_cached.go

    	return &cachedMetrics{wrapped: provider}
    }
    
    // GetMetrics runs the wrapped metrics provider's GetMetrics method once and
    // caches the result. Will not cache result if there is an error.
    // See MetricsProvider.GetMetrics
    func (md *cachedMetrics) GetMetrics() (*Metrics, error) {
    	md.once.cache(func() error {
    		md.resultMetrics, md.resultError = md.wrapped.GetMetrics()
    		return md.resultError
    	})
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Sep 16 11:12:06 UTC 2022
    - 1.9K bytes
    - Viewed (0)
  3. pkg/volume/metrics_block_linux_test.go

    	metrics := NewMetricsBlock("")
    	actual, err := metrics.GetMetrics()
    	expected := &Metrics{}
    	if !volumetest.MetricsEqualIgnoreTimestamp(actual, expected) {
    		t.Errorf("Expected empty Metrics from uninitialized MetricsBlock, actual %v", *actual)
    	}
    	if err == nil {
    		t.Errorf("Expected error when calling GetMetrics on uninitialized MetricsBlock, actual nil")
    	}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Oct 18 09:43:07 UTC 2022
    - 1.6K bytes
    - Viewed (0)
  4. pkg/volume/metrics_block.go

    }
    
    // See MetricsProvider.GetMetrics
    // GetMetrics detects the size of the BlockMode volume for the device node
    // where the Volume is attached.
    //
    // Note that only the capacity of the device can be detected with standard
    // tools. Storage systems may have more information that they can provide by
    // going through specialized APIs.
    func (mb *metricsBlock) GetMetrics() (*Metrics, error) {
    	startTime := time.Now()
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jan 19 14:33:37 UTC 2022
    - 2.5K bytes
    - Viewed (0)
  5. pkg/volume/csi/csi_metrics_test.go

    				fakeCloser := fake.NewCloser(t)
    				nodeClient.SetNodeVolumeStatsResp(getRawVolumeInfo())
    				return nodeClient, fakeCloser, nil
    			},
    		}
    		metrics, err := metricsGetter.GetMetrics()
    		if err != nil {
    			t.Fatalf("for %s: unexpected error : %v", tc.name, err)
    		}
    		if metrics == nil {
    			t.Fatalf("unexpected nil metrics")
    		}
    		expectedMetrics := getRawVolumeInfo()
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Sep 11 06:07:40 UTC 2023
    - 5.8K bytes
    - Viewed (0)
  6. pkg/volume/metrics_statfs.go

    func NewMetricsStatFS(path string) MetricsProvider {
    	return &metricsStatFS{path}
    }
    
    // See MetricsProvider.GetMetrics
    // GetMetrics calculates the volume usage and device free space by executing "du"
    // and gathering filesystem info for the Volume path.
    func (md *metricsStatFS) GetMetrics() (*Metrics, error) {
    	startTime := time.Now()
    	defer servermetrics.CollectVolumeStatCalDuration("statfs", startTime)
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jan 19 14:33:37 UTC 2022
    - 2.5K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apiserver/pkg/audit/policy/checker_test.go

    	test(t, "namespaced", audit.LevelNone, stages, stages, "getLogs")
    	test(t, "namespaced", audit.LevelNone, stages, stages, "getMetrics")
    	test(t, "namespaced", audit.LevelMetadata, stages, stages, "getMetrics", "serviceAccounts", "default")
    	test(t, "namespaced", audit.LevelRequestResponse, stages, stages, "getMetrics", "getPods", "default")
    	test(t, "namespaced", audit.LevelRequestResponse, stages, stages, "getPodLogs", "getPods")
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Oct 12 15:06:14 UTC 2021
    - 15.1K bytes
    - Viewed (0)
  8. pkg/kubelet/stats/host_stats_provider_fake.go

    	result := rootFsInfoToFsStats(rootFsInfo)
    	for i, metricsProvider := range metricsProviders {
    		hostMetrics, err := metricsProvider.GetMetrics()
    		if err != nil {
    			return nil, fmt.Errorf("failed to get stats for item %d: %v", i, err)
    		}
    		usedBytes := uint64(hostMetrics.Used.Value())
    		inodesUsed := uint64(hostMetrics.InodesUsed.Value())
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Feb 16 17:57:17 UTC 2024
    - 3.9K bytes
    - Viewed (0)
  9. pkg/kubelet/metrics/collectors/cri_metrics.go

    		return
    	}
    
    	for _, podMetric := range podMetrics {
    		for _, metric := range podMetric.GetMetrics() {
    			promMetric, err := c.criMetricToProm(metric)
    			if err == nil {
    				ch <- promMetric
    			}
    		}
    		for _, ctrMetric := range podMetric.GetContainerMetrics() {
    			for _, metric := range ctrMetric.GetMetrics() {
    				promMetric, err := c.criMetricToProm(metric)
    				if err == nil {
    					ch <- promMetric
    				}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Jan 23 13:24:29 UTC 2023
    - 4.3K bytes
    - Viewed (0)
  10. pkg/kubelet/stats/host_stats_provider.go

    	if _, err := os.Stat(podEtcHostsPath); os.IsNotExist(err) {
    		return nil, nil
    	}
    
    	metrics := volume.NewMetricsDu(podEtcHostsPath)
    	hostMetrics, err := metrics.GetMetrics()
    	if err != nil {
    		return nil, fmt.Errorf("failed to get stats %v", err)
    	}
    	result := rootFsInfoToFsStats(rootFsInfo)
    	usedBytes := uint64(hostMetrics.Used.Value())
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Feb 16 17:55:59 UTC 2024
    - 6.6K bytes
    - Viewed (0)
Back to top