log-analyze

来自「基于sipfoundy 公司开发的sipx协议API」· 代码 · 共 22 行

TXT
22
字号
#! /bin/perl# Script to analyze the logging output from CallScriptDriver to see# what the average load on the System Under Test was.# Called with two arguments, the 'number of jobs' and the 'number of# seconds to run' from the execution of CallScriptDriver.  Standard# input is the log.$jobs = $ARGV[0];$seconds = $ARGV[1];$pauses = 0;while (<STDIN>) {    if (/^pause random \d+ \(pause (\d+)\)/) {        $pauses += $1;    }}$pauses = int($pauses / 1000);print "jobs = $jobs, seconds = $seconds, pauses = $pauses, load average = ",    $jobs - $pauses / $seconds, "\n";

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?