1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-29 08:08:37 +00:00

Change the output of mctest to give a summary of the results instead

of printing a long list.

Add a default base port, and default mulitcast address to the
runner script.

Add support for specifying a different local and remote interface
in the runner script.

MFC after:	1 week
This commit is contained in:
George V. Neville-Neil 2010-10-01 14:36:36 +00:00
parent 220856f376
commit d329352945
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=213327
2 changed files with 34 additions and 13 deletions

View File

@ -38,6 +38,8 @@ __FBSDID("$FreeBSD$");
// C++ STL and other related includes
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
// Operating System and other C based includes
#include <unistd.h>
@ -400,15 +402,31 @@ int source(char *interface, struct in_addr *group, int pkt_size,
}
timeval result;
vector<int> deltas;
double idx[] = { .0001, .001, .01, .1, .5, .9, .99, .999, .9999, 0.0 };
for (int client = 0;client < clients; client++) {
deltas.clear();
cout << "Results from client #" << client << endl;
cout << "in usecs" << endl;
for (int i = 0; i < number; i++) {
if (i % clients != client)
continue;
// if (i % clients != client)
// continue;
if (&args[client].packets[i].tv_sec == 0)
continue;
timersub(&args[client].packets[i], &sent[i], &result);
cout << "sec: " << result.tv_sec;
cout << " usecs: " << result.tv_usec << endl;
deltas.push_back(result.tv_usec);
// cout << "sec: " << result.tv_sec;
// cout << " usecs: " << result.tv_usec << endl;
}
cout << "comparing %lu deltas" << long(deltas.size()) << endl;
cout << "number represents usecs of round-trip time" << endl;
sort(deltas.begin(), deltas.end());
for (int i = 0; idx[i] != 0; ++i) {
printf("%s% 5d", (i == 0) ? "" : " ",
deltas[(int) (idx[i] * deltas.size())]);
}
printf("\n");
}
return 0;

View File

@ -7,19 +7,19 @@
# Defaults
size=1024
number=100
base=""
group=""
base=9999
group="239.255.255.101"
interface="cxgb0"
remote="ssh"
command="/sources/FreeBSD.CURRENT/src/tools/tools/mctest/mctest"
command="/zoo/tank/users/gnn/svn/Projects/head-exar/src/tools/tools/mctest/mctest"
gap=1000
# Arguments are s (size), g (group), n (number), and c (command) followed
# by a set of hostnames.
args=`getopt s:g:n:c:i:b: $*`
args=`getopt s:g:n:c:l:f:b: $*`
if [ $? != 0 ]
then
echo 'Usage: mctest_run -s size -g group -n number -c remote command host1 host2 hostN'
echo 'Usage: mctest_run -l local_interface -f foreign_interface -s size -g group -n number -c remote command host1 host2 hostN'
exit 2
fi
set == $args
@ -40,8 +40,11 @@ do
-c)
command=$3;
shift 2;;
-i)
interface=$3;
-l)
local_interface=$3;
shift 2;;
-f)
foreign_interface=$3;
shift 2;;
-b)
base=$3;
@ -60,7 +63,7 @@ now=`date "+%Y%m%d%H%M"`
for host in $*
do
output=$host\_$interface\_$size\_$number\.$now
$remote $host $command -r -M $# -b $base -g $group -m $current -n $number -s $size -i $interface > $output &
$remote $host $command -r -M $# -b $base -g $group -m $current -n $number -s $size -i $foreign_interface > $output &
sleep 1
current=`expr $current + 1 `;
done
@ -68,4 +71,4 @@ done
#
# Start the source/collector on this machine
#
$command -M $# -b $base -g $group -n $number -s $size -i $interface -t $gap > `uname -n`\_$size\_$number\.$now
$command -M $# -b $base -g $group -n $number -s $size -i $local_interface -t $gap > `uname -n`\_$size\_$number\.$now