Skip to content

Commit

Permalink
Update rtt_fair to use multiple -H invocations for hostnames, and cha…
Browse files Browse the repository at this point in the history
…nge how

this works slightly (admit default values).
  • Loading branch information
tohojo committed Dec 10, 2012
1 parent 4a8e612 commit 6491efb
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 59 deletions.
17 changes: 14 additions & 3 deletions netperf_wrapper/settings.py
Expand Up @@ -124,8 +124,18 @@ def include_test(self, name, env=None):
self.execute(os.path.join(TEST_PATH, name))

def require_host_count(self, count):
if len(self.env['HOSTS']) < count and not self.env['INPUT']:
raise RuntimeError("Need %d hosts, only %d specified" % (count, len(self.env['HOSTS'])))
if len(self.env['HOSTS']) < count:
if 'DEFAULTS' in self.env and 'HOSTS' in self.env['DEFAULTS'] and self.env['DEFAULTS']['HOSTS']:
# If a default HOSTS list is set, populate the HOSTS list with
# values from this list, repeating as necessary up to count
def_hosts = self.env['DEFAULTS']['HOSTS']
host_c = len(self.env['HOSTS'])
missing_c = count-host_c
self.env['HOSTS'].extend((def_hosts * (missing_c//len(def_hosts)+1))[:missing_c])
if not self.env['HOST']:
self.env['HOST'] = self.env['HOSTS'][0]
else:
raise RuntimeError("Need %d hosts, only %d specified" % (count, len(self.env['HOSTS'])))

parser = optparse.OptionParser(description='Wrapper to run concurrent netperf-style tests',
usage="usage: %prog [options] -H <host> test")
Expand Down Expand Up @@ -225,8 +235,8 @@ def load():
results.append(r)


settings.load_test(test_name)
settings.update(results[0].meta())
settings.load_test(test_name)
else:
if len(args) < 1:
parser.error("Missing test name.")
Expand All @@ -236,6 +246,7 @@ def load():
settings.load_test(test_name)
results = [ResultSet(NAME=settings.NAME,
HOST=settings.HOST,
HOSTS=settings.HOSTS,
TIME=settings.TIME,
LOCAL_HOST=settings.LOCAL_HOST,
TITLE=settings.TITLE,
Expand Down
116 changes: 60 additions & 56 deletions tests/rtt_fair.conf
Expand Up @@ -4,30 +4,34 @@

include("netperf_definitions.inc")
DESCRIPTION="RTT Fair Realtime Response Under Load"
DEFAULTS={'PLOT': "all_scaled"}
HOST1='snapon.lab.bufferbloat.net'
HOST2='demo.tohojo.dk'
HOST3='snapon.lab.bufferbloat.net'
HOST4='demo.tohojo.dk'
DEFAULTS={'PLOT': "all_scaled",
'HOSTS': [
'snapon.lab.bufferbloat.net',
'demo.tohojo.dk']}

# This makes sure that four hosts are specified on the command line, and if not
# filles up the HOSTS list with input from the DEFAULTS above (repeating them if
# necessary).
min_host_count(4)

DATA_SETS = o([
('TCP upload BE %s' % HOST1,
{'command': "%s -Y CS0,CS0 -H %s -t TCP_STREAM -l %d -f m" % (GLOBAL_COMMAND, HOST1, LENGTH),
('TCP upload BE %s' % HOSTS[0],
{'command': "%s -Y CS0,CS0 -H %s -t TCP_STREAM -l %d -f m" % (GLOBAL_COMMAND, HOSTS[0], LENGTH),
'delay': DELAY,
'units': 'Mbits/s',
'runner': 'netperf_demo',}),
('TCP upload BE %s' % HOST2,
{'command': "%s -Y CS0,CS0 -H %s -t TCP_STREAM -l %d -f m" % (GLOBAL_COMMAND, HOST2, LENGTH),
('TCP upload BE %s' % HOSTS[1],
{'command': "%s -Y CS0,CS0 -H %s -t TCP_STREAM -l %d -f m" % (GLOBAL_COMMAND, HOSTS[1], LENGTH),
'delay': DELAY,
'units': 'Mbits/s',
'runner': 'netperf_demo',}),
('TCP upload BK %s' % HOST3,
{'command': "%s -Y CS1,CS1 -H %s -t TCP_STREAM -l %d -f m" % (GLOBAL_COMMAND, HOST3, LENGTH),
('TCP upload BK %s' % HOSTS[2],
{'command': "%s -Y CS1,CS1 -H %s -t TCP_STREAM -l %d -f m" % (GLOBAL_COMMAND, HOSTS[2], LENGTH),
'delay': DELAY,
'units': 'Mbits/s',
'runner': 'netperf_demo',}),
('TCP upload BK %s' % HOST4,
{'command': "%s -Y CS1,CS1 -H %s -t TCP_STREAM -l %d -f m" % (GLOBAL_COMMAND, HOST4, LENGTH),
('TCP upload BK %s' % HOSTS[3],
{'command': "%s -Y CS1,CS1 -H %s -t TCP_STREAM -l %d -f m" % (GLOBAL_COMMAND, HOSTS[3], LENGTH),
'delay': DELAY,
'units': 'Mbits/s',
'runner': 'netperf_demo',}),
Expand All @@ -40,23 +44,23 @@ DATA_SETS = o([
'units': 'Mbits/s',
'runner': 'sum',}),

('TCP download BE %s' % HOST1,
{'command': "%s -Y CS0,CS0 -H %s -t TCP_MAERTS -l %d -f m" % (GLOBAL_COMMAND, HOST1, LENGTH),
('TCP download BE %s' % HOSTS[0],
{'command': "%s -Y CS0,CS0 -H %s -t TCP_MAERTS -l %d -f m" % (GLOBAL_COMMAND, HOSTS[0], LENGTH),
'delay': DELAY,
'units': 'Mbits/s',
'runner': 'netperf_demo',}),
('TCP download BE %s' % HOST2,
{'command': "%s -Y CS0,CS0 -H %s -t TCP_MAERTS -l %d -f m" % (GLOBAL_COMMAND, HOST2, LENGTH),
('TCP download BE %s' % HOSTS[1],
{'command': "%s -Y CS0,CS0 -H %s -t TCP_MAERTS -l %d -f m" % (GLOBAL_COMMAND, HOSTS[1], LENGTH),
'delay': DELAY,
'units': 'Mbits/s',
'runner': 'netperf_demo',}),
('TCP download BK %s' % HOST3,
{'command': "%s -Y CS1,CS1 -H %s -t TCP_MAERTS -l %d -f m" % (GLOBAL_COMMAND, HOST3, LENGTH),
('TCP download BK %s' % HOSTS[2],
{'command': "%s -Y CS1,CS1 -H %s -t TCP_MAERTS -l %d -f m" % (GLOBAL_COMMAND, HOSTS[2], LENGTH),
'delay': DELAY,
'units': 'Mbits/s',
'runner': 'netperf_demo',}),
('TCP download BK %s' % HOST4 ,
{'command': "%s -Y CS1,CS1 -H %s -t TCP_MAERTS -l %d -f m" % (GLOBAL_COMMAND, HOST4, LENGTH),
('TCP download BK %s' % HOSTS[3] ,
{'command': "%s -Y CS1,CS1 -H %s -t TCP_MAERTS -l %d -f m" % (GLOBAL_COMMAND, HOSTS[3], LENGTH),
'delay': DELAY,
'units': 'Mbits/s',
'runner': 'netperf_demo',}),
Expand All @@ -69,24 +73,24 @@ DATA_SETS = o([
'units': 'Mbits/s',
'runner': 'sum',}),

('Ping (ms) ICMP %s' % HOST,
('Ping (ms) ICMP %s' % HOSTS[0],
{'command': '%s -D -i %.2f -w %d %s' % (PING, max(0.2,STEP_SIZE), TOTAL_LENGTH, HOST),
'units': 'ms',
'runner': 'ping',}),
('Ping (ms) ICMP %s' % HOST1,
{'command': '%s -D -i %.2f -w %d %s' % (PING, max(0.2,STEP_SIZE), TOTAL_LENGTH, HOST1),
('Ping (ms) ICMP %s' % HOSTS[0],
{'command': '%s -D -i %.2f -w %d %s' % (PING, max(0.2,STEP_SIZE), TOTAL_LENGTH, HOSTS[0]),
'units': 'ms',
'runner': 'ping',}),
('Ping (ms) ICMP %s' % HOST2,
{'command': '%s -D -i %.2f -w %d %s' % (PING, max(0.2,STEP_SIZE), TOTAL_LENGTH, HOST2),
('Ping (ms) ICMP %s' % HOSTS[1],
{'command': '%s -D -i %.2f -w %d %s' % (PING, max(0.2,STEP_SIZE), TOTAL_LENGTH, HOSTS[1]),
'units': 'ms',
'runner': 'ping',}),
('Ping (ms) ICMP %s' % HOST3,
{'command': '%s -D -i %.2f -w %d %s' % (PING, max(0.2,STEP_SIZE), TOTAL_LENGTH, HOST3),
('Ping (ms) ICMP %s' % HOSTS[2],
{'command': '%s -D -i %.2f -w %d %s' % (PING, max(0.2,STEP_SIZE), TOTAL_LENGTH, HOSTS[2]),
'units': 'ms',
'runner': 'ping',}),
('Ping (ms) ICMP %s' % HOST4,
{'command': '%s -D -i %.2f -w %d %s' % (PING, max(0.2,STEP_SIZE), TOTAL_LENGTH, HOST4),
('Ping (ms) ICMP %s' % HOSTS[3],
{'command': '%s -D -i %.2f -w %d %s' % (PING, max(0.2,STEP_SIZE), TOTAL_LENGTH, HOSTS[3]),
'units': 'ms',
'runner': 'ping',}),
('Ping (ms) avg',
Expand All @@ -100,15 +104,15 @@ PLOTS = o([
{'description': 'Download bandwidth plot',
'type': 'timeseries',
'legend_title': 'TCP download',
'series': [{'data': 'TCP download BE %s' % HOST1,
'label': 'BE %s' %HOST1,
'series': [{'data': 'TCP download BE %s' % HOSTS[0],
'label': 'BE %s' %HOSTS[0],
'linewidth': 2.0},
{'data': 'TCP download BE %s' % HOST2,
'label': 'BE %s' % HOST2 },
{'data': 'TCP download BK %s' % HOST3,
'label': 'BK %s' % HOST3 },
{'data': 'TCP download BK %s' % HOST4,
'label': 'BK %s' % HOST4},
{'data': 'TCP download BE %s' % HOSTS[1],
'label': 'BE %s' % HOSTS[1] },
{'data': 'TCP download BK %s' % HOSTS[2],
'label': 'BK %s' % HOSTS[2] },
{'data': 'TCP download BK %s' % HOSTS[3],
'label': 'BK %s' % HOSTS[3]},
{'data': 'TCP download avg',
'label': 'Avg',
'smoothing': 10,
Expand All @@ -124,15 +128,15 @@ PLOTS = o([
{'description': 'Upload bandwidth plot',
'type': 'timeseries',
'legend_title': 'TCP upload',
'series': [{'data': 'TCP upload BE %s' % HOST1,
'label': 'BE %s' % HOST1,
'series': [{'data': 'TCP upload BE %s' % HOSTS[0],
'label': 'BE %s' % HOSTS[0],
'linewidth': 2.0},
{'data': 'TCP upload BE %s' % HOST2,
'label': 'BE %s' % HOST2},
{'data': 'TCP upload BK %s' % HOST3,
'label': 'BK %s' % HOST3},
{'data': 'TCP upload BK %s' % HOST4,
'label': 'BK %s' % HOST4},
{'data': 'TCP upload BE %s' % HOSTS[1],
'label': 'BE %s' % HOSTS[1]},
{'data': 'TCP upload BK %s' % HOSTS[2],
'label': 'BK %s' % HOSTS[2]},
{'data': 'TCP upload BK %s' % HOSTS[3],
'label': 'BK %s' % HOSTS[3]},
{'data': 'TCP upload avg',
'label': 'Avg',
'smoothing': 10,
Expand All @@ -149,16 +153,16 @@ PLOTS = o([
'type': 'timeseries',
'legend_title': 'Ping (ms)',
'series': [
{'data': 'Ping (ms) ICMP %s' % HOST,
'label': 'ICMP %s' % HOST },
{'data': 'Ping (ms) ICMP %s' % HOST1,
'label': 'ICMP %s' % HOST1 },
{'data': 'Ping (ms) ICMP %s' % HOST2,
'label': 'ICMP %s' % HOST2 },
{'data': 'Ping (ms) ICMP %s' % HOST3,
'label': 'ICMP %s' % HOST3 },
{'data': 'Ping (ms) ICMP %s' % HOST4,
'label': 'ICMP %s' % HOST4 },
{'data': 'Ping (ms) ICMP %s' % HOSTS[0],
'label': 'ICMP %s' % HOSTS[0] },
{'data': 'Ping (ms) ICMP %s' % HOSTS[0],
'label': 'ICMP %s' % HOSTS[0] },
{'data': 'Ping (ms) ICMP %s' % HOSTS[1],
'label': 'ICMP %s' % HOSTS[1] },
{'data': 'Ping (ms) ICMP %s' % HOSTS[2],
'label': 'ICMP %s' % HOSTS[2] },
{'data': 'Ping (ms) ICMP %s' % HOSTS[3],
'label': 'ICMP %s' % HOSTS[3] },
{'data': 'Ping (ms) avg',
'label': 'Avg',
'smoothing': 10,
Expand Down

0 comments on commit 6491efb

Please sign in to comment.