Skip to content

Commit dd030dd

Browse files
committed
Set RSS output from listener to main log
Merged and disabled changes in the previous 2 commmits and set RSS output from listener to main log only.
1 parent f33f3e8 commit dd030dd

File tree

3 files changed

+6
-20
lines changed

3 files changed

+6
-20
lines changed

lib/pytap13.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
import re
2020

21+
from lib.colorer import color_log
22+
2123
try:
2224
# Python 2
2325
from StringIO import StringIO
@@ -139,6 +141,7 @@ def _parse(self, source):
139141

140142
if seek_test:
141143
m = RE_TEST_LINE.match(line)
144+
color_log('%s\n' % line, schema='test-run command')
142145
if m and on_top_level:
143146
self.__tests_counter += 1
144147
t_attrs = m.groupdict()

lib/tarantool_server.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
from lib.utils import signame
4444
from lib.utils import warn_unix_socket
4545
from lib.utils import prefix_each_line
46-
from lib.utils import get_mem_stat_rss
4746
from lib.test import TestRunGreenlet, TestExecutionError
4847

4948

@@ -199,9 +198,6 @@ def send_command_raw(self, command, ts):
199198
color_log("DEBUG: tarantool's response for [{}]\n{}\n".format(
200199
command.rstrip(), prefix_each_line(' | ', result)),
201200
schema='tarantool command')
202-
if (Options().args.collect_statistics):
203-
color_log('RSS: {}\n' . format(get_mem_stat_rss()),
204-
schema='tarantool command')
205201
return result
206202

207203
def set_language(self, ts, language):

listeners.py

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ def save_artifacts(self):
127127
class LogOutputWatcher(BaseWatcher):
128128
def __init__(self):
129129
self.fds = dict()
130-
self.fds_stat = dict()
131130
self.logdir = os.path.join(Options().args.vardir, 'log')
132131
try:
133132
os.makedirs(self.logdir)
@@ -139,26 +138,14 @@ def get_logfile(self, worker_name):
139138
filepath = os.path.join(self.logdir, filename)
140139
return os.path.realpath(filepath)
141140

142-
def get_statfile(self, worker_name):
143-
filename = '%s.mem_stat.log' % worker_name
144-
filepath = os.path.join(self.logdir, filename)
145-
return os.path.realpath(filepath)
146-
147141
def process_result(self, obj):
148142
if isinstance(obj, WorkerDone):
149143
self.fds[obj.worker_id].close()
150144
del self.fds[obj.worker_id]
151-
self.fds_stat[obj.worker_id].close()
152-
del self.fds_stat[obj.worker_id]
153145

154146
if not isinstance(obj, WorkerOutput):
155147
return
156148

157-
if obj.worker_id not in self.fds_stat.keys():
158-
filepath = self.get_statfile(obj.worker_name)
159-
self.fds_stat[obj.worker_id] = open(filepath, 'w')
160-
fd_stat = self.fds_stat[obj.worker_id]
161-
162149
if obj.worker_id not in self.fds.keys():
163150
filepath = self.get_logfile(obj.worker_name)
164151
self.fds[obj.worker_id] = open(filepath, 'w')
@@ -182,10 +169,10 @@ def process_result(self, obj):
182169
output = prefix_each_line(prefix, output)
183170

184171
fd.write(output)
185-
fd.flush()
186172
if (Options().args.collect_statistics):
187-
fd_stat.write(get_mem_stat_rss())
188-
fd_stat.flush()
173+
rss = '{}RSS: {}' . format(prefix, get_mem_stat_rss())
174+
fd.write(rss)
175+
fd.flush()
189176

190177
def __del__(self):
191178
for fd in self.fds.values():

0 commit comments

Comments
 (0)