Skip to content

Commit

Permalink
Export kafka version in env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
lisguo committed Dec 2, 2024
1 parent 3d65741 commit 76a841c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions test/metric_value_benchmark/jmx_kafka_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
package metric_value_benchmark

import (
"fmt"
"log"
"time"

Expand Down Expand Up @@ -54,12 +53,10 @@ func (t *JMXKafkaTestRunner) SetupBeforeAgentRun() error {
return err
}

log.Println("get latest kafka version")
version, err := common.RunCommand("curl https://dlcdn.apache.org/kafka/ | grep -oE \"\\d\\.\\d\\.\\d\" | tail -1")

log.Println("set up zookeeper and kafka")
startJMXCommands := []string{
fmt.Sprintf("curl https://dlcdn.apache.org/kafka/%s/kafka_2.13-%s.tgz -o kafka_2.13-latest.tgz", version, version),
"export KAFKA_VERSION=curl https://dlcdn.apache.org/kafka/ | grep -oE '\\d\\.\\d\\.\\d' | tail -1",
"curl https://dlcdn.apache.org/kafka/$KAFKA_VERSION/kafka_2.13-$KAFKA_VERSION.tgz -o kafka_2.13-latest.tgz",
"tar -xzf kafka_2.13-latest.tgz",
"echo 'export JMX_PORT=2000'|cat - kafka_2.13-latest/bin/kafka-server-start.sh > /tmp/kafka-server-start.sh && mv /tmp/kafka-server-start.sh kafka_2.13-latest/bin/kafka-server-start.sh",
"echo 'export JMX_PORT=2010'|cat - kafka_2.13-latest/bin/kafka-console-consumer.sh > /tmp/kafka-console-consumer.sh && mv /tmp/kafka-console-consumer.sh kafka_2.13-latest/bin/kafka-console-consumer.sh",
Expand Down

0 comments on commit 76a841c

Please sign in to comment.