summaryrefslogtreecommitdiffstats
path: root/Tools/portbuild/scripts/reportload
blob: 0044db5cc75c8b0e029d046e25a28f8e251003fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
#
# This is run on the clients to report their loads to the server.
# Every 5 seconds we concatenate the number of currently building ports with
# the machine uptime and push it to the server.

# configurable variables
pb=/var/portbuild
arch=$1

. ${pb}/${arch}/portbuild.conf

me=$(hostname -s)
tmpfile=${scratchdir}/${me}

while true; do
  num=$(echo $(ls -1d ${scratchdir}/*/chroot/*/used 2>/dev/null| wc -l))
  echo -n "$num " > ${tmpfile}
  uptime >> ${tmpfile}
  scp -q ${tmpfile} ${user}@${master}:${pb}/${arch}/loads/
  rm -f ${tmpfile}
  sleep 5
done
OpenPOWER on IntegriCloud