Skip to content

Commit 116f8b2

Browse files
authored
Use Dool instead of Dstat (TechEmpower#8335)
Dstat is no longer maintained.
1 parent 5d5d1e2 commit 116f8b2

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

Dockerfile

+11-4
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ RUN apt-get -yqq update && \
1010
-o Dpkg::Options::="--force-confold" \
1111
cloc \
1212
curl \
13-
# Collect resource usage statistics
14-
dstat \
1513
gcc \
1614
git-core \
1715
gosu \
@@ -36,6 +34,14 @@ RUN pip3 install \
3634
# https://github.com/docker/docker-py/issues/3113#issuecomment-1525500104
3735
requests==2.28.1
3836

37+
# Collect resource usage statistics
38+
ARG DOOL_VERSION=v1.2.0
39+
40+
WORKDIR /tmp
41+
RUN curl -LSs "https://github.com/scottchiefbaker/dool/archive/${DOOL_VERSION}.tar.gz" | \
42+
tar --strip-components=1 -xz && \
43+
./install.py
44+
3945
# Check if the group ID is already created
4046
ARG GROUP_ID
4147
RUN if ! getent group "$GROUP_ID"; then \
@@ -48,6 +54,7 @@ RUN if ! getent passwd "$USER_ID"; then \
4854
adduser --disabled-password --gecos '' --gid "$GROUP_ID" --uid "$USER_ID" user; \
4955
fi
5056

51-
ENV FWROOT=/FrameworkBenchmarks PYTHONPATH=/FrameworkBenchmarks USER_ID="$USER_ID"
57+
ENV FWROOT=/FrameworkBenchmarks USER_ID="$USER_ID"
58+
ENV PYTHONPATH="$FWROOT"
5259

53-
ENTRYPOINT ["FrameworkBenchmarks/entrypoint.sh"]
60+
ENTRYPOINT ["/FrameworkBenchmarks/entrypoint.sh"]

entrypoint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ set -eo pipefail -u
44

55
chown -LR "$USER_ID" /var/run
66
# Drop permissions of user to match those of the host system
7-
gosu "$USER_ID" python3 /FrameworkBenchmarks/toolset/run-tests.py "$@"
7+
gosu "$USER_ID" python3 "${FWROOT}/toolset/run-tests.py" "$@"

toolset/benchmark/benchmarker.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -307,11 +307,11 @@ def __begin_logging(self, framework_test, test_type):
307307
output_file = "{file_name}".format(
308308
file_name=self.results.get_stats_file(framework_test.name,
309309
test_type))
310-
dstat_string = "dstat -Tafilmprs --aio --fs --ipc --lock --socket --tcp \
310+
dool_string = "dool -Tafilmprs --aio --fs --ipc --lock --socket --tcp \
311311
--raw --udp --unix --vm --disk-util \
312312
--rpc --rpcd --output {output_file}".format(
313313
output_file=output_file)
314-
cmd = shlex.split(dstat_string)
314+
cmd = shlex.split(dool_string)
315315
self.subprocess_handle = subprocess.Popen(
316316
cmd, stdout=FNULL, stderr=subprocess.STDOUT)
317317

toolset/utils/results.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ def __parse_stats(self, framework_test, test_type, start_time, end_time,
453453
stats_dict = dict()
454454
stats_file = self.get_stats_file(framework_test.name, test_type)
455455
with open(stats_file) as stats:
456-
# dstat doesn't output a completely compliant CSV file - we need to strip the header
456+
# dool doesn't output a completely compliant CSV file - we need to strip the header
457457
for _ in range(4):
458458
next(stats)
459459
stats_reader = csv.reader(stats)

0 commit comments

Comments
 (0)