OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 |
3 # Copyright 2013 The Chromium Authors. All rights reserved. | 3 # Copyright 2013 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 # Produce memory metrics for run_apply_test | 7 # Produce memory metrics for run_apply_test |
8 | 8 |
9 error() { | 9 source "$(dirname ${0})/stress_test_common" |
10 echo "error: ${@}" >&2 | |
11 } | |
12 | 10 |
13 compute_percentiles() { | 11 compute_percentiles() { |
14 if [ -z "${1}" ]; then | 12 if [ -z "${1}" ]; then |
15 return; | 13 return; |
16 fi | 14 fi |
17 local pctls=".5 .9 1" | 15 local pctls=".5 .9 1" |
18 local lines=$(cat ${1} | wc -l) | 16 local lines=$(cat ${1} | wc -l) |
19 for p in $pctls; do | 17 for p in $pctls; do |
20 local count="$(echo "${lines} * $p" | bc -lq | cut -d. -f1)" | 18 local count="$(echo "${lines} * $p" | bc -lq | cut -d. -f1)" |
21 local bytes=$(cat ${1} \ | 19 local bytes=$(cat ${1} \ |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 | head -n1 | 85 | head -n1 |
88 done | sort -k2 -n > "${metrics_bsdiff_tmp}" | 86 done | sort -k2 -n > "${metrics_bsdiff_tmp}" |
89 mv "${metrics_bsdiff_tmp}" "${metrics_bsdiff}" | 87 mv "${metrics_bsdiff_tmp}" "${metrics_bsdiff}" |
90 fi | 88 fi |
91 | 89 |
92 echo "$(compute_percentiles ${metrics_bsdiff})max heap per file for bsdiff" \ | 90 echo "$(compute_percentiles ${metrics_bsdiff})max heap per file for bsdiff" \ |
93 "(50th 90th 100th)" | 91 "(50th 90th 100th)" |
94 } | 92 } |
95 | 93 |
96 main "${@}" | 94 main "${@}" |
OLD | NEW |