Skip to content

Commit 14c128a

Browse files
ewencpguozhangwang
authored andcommitted
MINOR: Capture stderr in ConsumerPerformanceService.
Author: Ewen Cheslack-Postava <[email protected]> Reviewers: Guozhang Wang Closes apache#331 from ewencp/minor-capture-consumer-performance-stderr
1 parent 343db8a commit 14c128a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/kafkatest/services/performance/consumer_performance.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class ConsumerPerformanceService(PerformanceService):
5151
PERSISTENT_ROOT = "/mnt/consumer_performance"
5252
LOG_DIR = os.path.join(PERSISTENT_ROOT, "logs")
5353
STDOUT_CAPTURE = os.path.join(PERSISTENT_ROOT, "consumer_performance.stdout")
54+
STDERR_CAPTURE = os.path.join(PERSISTENT_ROOT, "consumer_performance.stderr")
5455
LOG_FILE = os.path.join(LOG_DIR, "consumer_performance.log")
5556
LOG4J_CONFIG = os.path.join(PERSISTENT_ROOT, "tools-log4j.properties")
5657
CONFIG_FILE = os.path.join(PERSISTENT_ROOT, "consumer.properties")
@@ -59,7 +60,9 @@ class ConsumerPerformanceService(PerformanceService):
5960
"consumer_performance_output": {
6061
"path": STDOUT_CAPTURE,
6162
"collect_default": True},
62-
63+
"consumer_performance_stderr": {
64+
"path": STDERR_CAPTURE,
65+
"collect_default": True},
6366
"consumer_performance_log": {
6467
"path": LOG_FILE,
6568
"collect_default": True}
@@ -129,7 +132,8 @@ def start_cmd(self):
129132
for key, value in self.settings.items():
130133
cmd += " %s=%s" % (str(key), str(value))
131134

132-
cmd += " | tee %s" % ConsumerPerformanceService.STDOUT_CAPTURE
135+
cmd += " 2>> %(stderr)s | tee -a %(stdout)s" % {'stdout': ConsumerPerformanceService.STDOUT_CAPTURE,
136+
'stderr': ConsumerPerformanceService.STDERR_CAPTURE}
133137
return cmd
134138

135139
def _worker(self, idx, node):

0 commit comments

Comments
 (0)