Skip to content

Commit

Permalink
minor adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
musa-asad committed Dec 20, 2024
1 parent 8bf4517 commit 8e94f74
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
11 changes: 5 additions & 6 deletions test/e2e/jmx/jmx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,14 @@ var testResourcesRegistry = []func(*testing.T){
}

var nodeNames []string
var env *environment.MetaData

func TestMain(m *testing.M) {
flag.Parse()
if flag.Lookup("test.run").Value.String() == "NO_MATCH" {
os.Exit(0)
}
env := environment.GetEnvironmentMetaData()
env = environment.GetEnvironmentMetaData()

if env.Destroy {
if err := common.DestroyResources(env); err != nil {
Expand Down Expand Up @@ -135,7 +136,6 @@ func testJMXResources(t *testing.T) {
}

func testMetrics(t *testing.T) {
env := environment.GetEnvironmentMetaData()
configFile := filepath.Base(env.AgentConfig)

tests, exists := testMetricsRegistry[configFile]
Expand Down Expand Up @@ -234,13 +234,12 @@ func testKafkaMetrics(t *testing.T) {
"kafka.request.time.50p",
"kafka.request.time.99p",
"kafka.request.time.avg",
"kafka.producer.io-wait-time-ns-avg",
"kafka.producer.outgoing-byte-rate",
"kafka.producer.request-rate",
"kafka.producer.response-rate",
"kafka.consumer.fetch-rate",
"kafka.consumer.total.bytes-consumed-rate",
"kafka.consumer.total.records-consumed-rate",
"kafka.producer.io-wait-time-ns-avg",
"kafka.producer.outgoing-byte-rate",
"kafka.producer.response-rate",
}

for _, metric := range metricsToCheck {
Expand Down
1 change: 0 additions & 1 deletion test/e2e/jmx/resources/cwagent_configs/kafka.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"measurement": [
"kafka.producer.io-wait-time-ns-avg",
"kafka.producer.outgoing-byte-rate",
"kafka.producer.request-rate",
"kafka.producer.response-rate"
]
},
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/jmx/resources/sample_apps/kafka.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ spec:
- name: kafka-producer
image: public.ecr.aws/l9b8e0i6/kafka:latest
command: ["/bin/sh"]
args: ["-c", "while true; do echo message | kafka-console-producer.sh --topic quickstart-events --bootstrap-server kafka-service:9092; sleep 5; done"]
args: ["-c", "yes | nohup kafka-console-producer.sh --topic quickstart-events --bootstrap-server kafka-service:9092"]
---
apiVersion: apps/v1
kind: Deployment
Expand Down

0 comments on commit 8e94f74

Please sign in to comment.