From a3f04c718dd31c7cacffc825db47a87c673beb4c Mon Sep 17 00:00:00 2001 From: Hyunsoo Kim Date: Wed, 3 Apr 2024 11:00:24 -0400 Subject: [PATCH] add wait time and remove unused method --- test/gpu/nvidia_test.go | 2 +- test/metric/metric_list_query.go | 35 -------------------------------- 2 files changed, 1 insertion(+), 36 deletions(-) diff --git a/test/gpu/nvidia_test.go b/test/gpu/nvidia_test.go index 8f2a43310..ced990b36 100644 --- a/test/gpu/nvidia_test.go +++ b/test/gpu/nvidia_test.go @@ -110,7 +110,7 @@ func (t *NvidiaTestRunner) GetAgentConfigFileName() string { } func (t *NvidiaTestRunner) GetAgentRunDuration() time.Duration { - return 0 + return 3 * time.Minute } func (t *NvidiaTestRunner) GetMeasuredMetrics() []string { diff --git a/test/metric/metric_list_query.go b/test/metric/metric_list_query.go index 18ea689ff..afe07f6c1 100644 --- a/test/metric/metric_list_query.go +++ b/test/metric/metric_list_query.go @@ -56,38 +56,3 @@ func (n *Fetcher) Fetch(namespace, metricName string, dimensions []types.Dimensi log.Printf("total number of metrics fetched: %v", len(metrics)) return metrics, nil } - -func (n *Fetcher) FetchByDimension(namespace string, dimensions []types.Dimension) ([]types.Metric, error) { - var dims []types.DimensionFilter - for _, dim := range dimensions { - dims = append(dims, types.DimensionFilter{ - Name: dim.Name, - Value: dim.Value, - }) - } - - listMetricInput := cloudwatch.ListMetricsInput{ - Namespace: aws.String(namespace), - Dimensions: dims, - } - - log.Printf("Metric data input: namespace %v, dimensions %v", namespace, fmt.Sprint(&dims)) - - var metrics []types.Metric - for { - // get a complete list of metrics with given dimensions - output, err := awsservice.CwmClient.ListMetrics(context.Background(), &listMetricInput) - if err != nil { - return nil, fmt.Errorf("Error getting metric data %v", err) - } - metrics = append(metrics, output.Metrics...) - // nil or empty nextToken means there is no more data to be fetched - nextToken := output.NextToken - if nextToken == nil || *nextToken == "" { - break - } - listMetricInput.NextToken = nextToken - } - log.Printf("total number of metrics fetched: %v", len(metrics)) - return metrics, nil -}