Skip to content

Commit b50317e

Browse files
committed
travis: print system load statistics from "top" into stdout as we run ci.
Currently commented out, can be commented in in .travis.yml if needed.
1 parent 2079a08 commit b50317e

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

.travis.yml

+3
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ env:
201201
- secure: "cFh8thThqEJLC98XKI5pfqflUzOlxsYPRW20AWRaYOOgYHPTiGWypTXiPbGSKaeAXTZoOA+DpQtEmefc0U6lt9dHc7a/MIaK6isFurjlnKYiLOeTruzyu1z7PWCeZ/jKXsU2RK/88DBtlNwfMdaMIeuKj14IVfpepPPL71ETbuk="
202202

203203
before_install:
204+
# - ./src/ci/top.sh &
204205
- zcat $HOME/docker/rust-ci.tar.gz | docker load || true
205206
- mkdir -p $HOME/rustsrc
206207
# FIXME(#46924): these two commands are required to enable IPv6,
@@ -290,6 +291,8 @@ after_failure:
290291
# the failure was while updating it (as it may be in a bad state)
291292
# https://github.com/travis-ci/travis-ci/issues/4472
292293
before_cache:
294+
# - echo "top statistics:"
295+
# - cat /tmp/top.log
293296
- docker history -q rust-ci |
294297
grep -v missing |
295298
xargs docker save |

src/ci/top.sh

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
# Copyright 2018 The Rust Project Developers. See the COPYRIGHT
3+
# file at the top-level directory of this distribution and at
4+
# http://rust-lang.org/COPYRIGHT.
5+
#
6+
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
7+
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
8+
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
9+
# option. This file may not be copied, modified, or distributed
10+
# except according to those terms.
11+
12+
while `sleep 30`
13+
do
14+
# get tops summary and print it into a logfile every 30 secs
15+
# run top in batch mode (b), skip idle processes (i) and quite after first output (n 1)
16+
top -ibn 1 | head -n4 | tr "\n" " " | tee -a /tmp/top.log
17+
echo "" | tee -a /tmp/top.log
18+
done

0 commit comments

Comments
 (0)