perf_pathkit.sh 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/bash
  2. # Copyright 2018 Google LLC
  3. #
  4. # Use of this source code is governed by a BSD-style license that can be
  5. # found in the LICENSE file.
  6. # This assumes it is being run inside a docker container of perf-karma-chrome-tests
  7. # and a Skia checkout has been mounted at /SRC and the output directory
  8. # is mounted at /OUT
  9. # For example:
  10. # docker run -v $SKIA_ROOT:/SRC -v /tmp/dockerout:/OUT gcr.io/skia-public/perf-karma-chrome-tests:72.0.3626.121_v1 /SRC/infra/pathkit/perf_pathkit.sh
  11. set -ex
  12. #BASE_DIR is the dir this script is in ($SKIA_ROOT/infra/pathkit)
  13. BASE_DIR=`cd $(dirname ${BASH_SOURCE[0]}) && pwd`
  14. PATHKIT_DIR=$BASE_DIR/../../modules/pathkit
  15. # Start the aggregator in the background
  16. /opt/perf-aggregator $@ &
  17. # Run the tests 10 times to get a wide set of data
  18. for i in `seq 1 10`;
  19. do
  20. npx karma start $PATHKIT_DIR/karma.bench.conf.js --single-run
  21. done
  22. # Tell the aggregator to dump the json
  23. # This curl command gets the HTTP code and stores it into $CODE
  24. CODE=`curl -s -o /dev/null -I -w "%{http_code}" -X POST localhost:8081/dump_json`
  25. if [ $CODE -ne 200 ]; then
  26. # If we don't get 200 back, something is wrong with writing to disk, so exit with error
  27. exit 1
  28. fi