Skip to content

Commit

Permalink
running lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Paramadon committed Apr 23, 2024
1 parent 05834b2 commit c73f8e2
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 18 deletions.
3 changes: 0 additions & 3 deletions terraform/ec2/mac/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,6 @@ resource "null_resource" "integration_test" {
"echo Execute integration tests",
"export AWS_REGION=${var.region}",
"sudo chmod +x ./validator",
"cd amazon-cloudwatch-agent-test",
"git checkout MacOSEC2Test -f",
"cd ..",
"./validator --validator-config=${module.validator.instance_validator_config} --preparation-mode=true",
"sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -s -c file:${module.validator.instance_agent_config}",
"./validator --validator-config=${module.validator.instance_validator_config} --preparation-mode=false",
Expand Down
10 changes: 0 additions & 10 deletions test/metric/metric_value_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package metric

import (
"context"
"encoding/json"
"fmt"
"log"
"strings"
Expand Down Expand Up @@ -51,15 +50,6 @@ func (n *MetricValueFetcher) Fetch(namespace, metricName string, metricSpecificD
},
}

// Marshal the metricDataQueries slice into JSON with indentation
jsonData, err := json.MarshalIndent(metricDataQueries, "", " ")
if err != nil {
fmt.Println("Error marshaling JSON:", err)
}

// Print the JSON data
fmt.Println(string(jsonData))

endTime := time.Now()
startTime := subtractMinutes(endTime, 10)
getMetricDataInput := cloudwatch.GetMetricDataInput{
Expand Down
2 changes: 1 addition & 1 deletion validator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package main
import (
"flag"
"fmt"
"github.com/aws/amazon-cloudwatch-agent-test/validator/validators/basic"
"log"
"os"
"strings"
Expand All @@ -19,6 +18,7 @@ import (
"github.com/aws/amazon-cloudwatch-agent-test/util/common"
"github.com/aws/amazon-cloudwatch-agent-test/validator/models"
"github.com/aws/amazon-cloudwatch-agent-test/validator/validators"
"github.com/aws/amazon-cloudwatch-agent-test/validator/validators/basic"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion validator/validators/basic/basic_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import (
"strings"
"time"

apMetrics "github.com/aws/amazon-cloudwatch-agent-test/test/metric"
cwtypes "github.com/aws/aws-sdk-go-v2/service/cloudwatch/types"
cwltypes "github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types"
"github.com/aws/aws-sdk-go/aws"
"go.uber.org/multierr"

apMetrics "github.com/aws/amazon-cloudwatch-agent-test/test/metric"
"github.com/aws/amazon-cloudwatch-agent-test/util/awsservice"
"github.com/aws/amazon-cloudwatch-agent-test/util/common"
"github.com/aws/amazon-cloudwatch-agent-test/util/common/traces"
Expand Down
4 changes: 1 addition & 3 deletions validator/validators/stress/stress_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,10 +406,8 @@ func (s *StressValidator) ValidateStressMetric(metricName, metricNamespace strin

// Validate if the metrics are not dropping any metrics and able to backfill within the same minute (e.g if the memory_rss metric is having collection_interval 1
// , it will need to have 60 sample counts - 1 datapoint / second)
if ok := awsservice.ValidateSampleCount(metricName, metricNamespace, metricDimensions, startTime, endTime, 5, 10, int32(boundAndPeriod)); !ok {
if ok := awsservice.ValidateSampleCount(metricName, metricNamespace, metricDimensions, startTime, endTime, metricSampleCount-5, metricSampleCount, int32(boundAndPeriod)); !ok {
return fmt.Errorf("\n metric %s is not within sample count bound [ %d, %d]", metricName, metricSampleCount-5, metricSampleCount)
} else {
fmt.Println("Yayyyyyyy!!!!!!! sample count is good for :", metricName, metricSampleCount)
}

return nil
Expand Down

0 comments on commit c73f8e2

Please sign in to comment.