#!/bin/bash # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # Produce metrics analyzing the output of a stress test source "$(dirname ${0})/stress_test_common" set -e # Given a token, search for and compute the percentiles from logfile. compute_percentiles() { if [ ! -z "${1}" ]; then local pctls=".5 .9 1" local lines=$(count_result ${1}) for p in $pctls; do local count="$(echo "${lines} * $p" | bc -lq | cut -d. -f1)" echo -n $(cat ${log} \ | grep ${1} \ | cut -d' ' -f2 \ | sort -n \ | head -n$count \ | tail -n1) echo -n "s " done fi } main() { if [ $# -lt 1 ]; then cat <