Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 40 for getMetrics (0.18 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_statfs_test.go

    func TestGetMetricsStatFS(t *testing.T) {
    	metrics := NewMetricsStatFS("")
    	actual, err := metrics.GetMetrics()
    	expected := &Metrics{}
    	if !volumetest.MetricsEqualIgnoreTimestamp(actual, expected) {
    		t.Errorf("Expected empty Metrics from uninitialized MetricsStatFS, actual %v", *actual)
    	}
    	if err == nil {
    		t.Errorf("Expected error when calling GetMetrics on uninitialized MetricsStatFS, actual nil")
    	}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Mar 02 23:01:59 UTC 2017
    - 2K bytes
    - Viewed (0)
  4. 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)
  5. 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)
  6. pkg/volume/metrics_du.go

    func NewMetricsDu(path string) MetricsProvider {
    	return &metricsDu{path}
    }
    
    // GetMetrics calculates the volume usage and device free space by executing "du"
    // and gathering filesystem info for the Volume path.
    // See MetricsProvider.GetMetrics
    func (md *metricsDu) GetMetrics() (*Metrics, error) {
    	metrics := &Metrics{Time: metav1.Now()}
    	if md.path == "" {
    		return metrics, NewNoPathDefinedError()
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Apr 06 12:19:35 UTC 2021
    - 2.5K bytes
    - Viewed (0)
  7. pkg/volume/metrics_nil_test.go

    	}
    }
    
    func TestMetricsNilGetCapacity(t *testing.T) {
    	metrics := &MetricsNil{}
    	actual, err := metrics.GetMetrics()
    	expected := &Metrics{}
    	if *actual != *expected {
    		t.Errorf("Expected empty Metrics, actual %v", *actual)
    	}
    	if err == nil {
    		t.Errorf("Expected error when calling GetMetrics, actual nil")
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu May 20 15:10:23 UTC 2021
    - 1.1K bytes
    - Viewed (0)
  8. pkg/volume/metrics_nil.go

    type MetricsNil struct{}
    
    // SupportsMetrics returns false for the MetricsNil type.
    func (*MetricsNil) SupportsMetrics() bool {
    	return false
    }
    
    // GetMetrics returns an empty Metrics and an error.
    // See MetricsProvider.GetMetrics
    func (*MetricsNil) GetMetrics() (*Metrics, error) {
    	return &Metrics{}, NewNotSupportedError()
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu May 20 15:10:23 UTC 2021
    - 1.1K bytes
    - Viewed (0)
  9. 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)
  10. 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)
Back to top