Skip to content

Commit

Permalink
Fix bug with container_netperf which was out of sync with parsing code
Browse files Browse the repository at this point in the history
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=241601309
  • Loading branch information
ehankland authored and dlott committed Apr 2, 2019
1 parent 253b861 commit 431b8e8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
1 change: 1 addition & 0 deletions perfkitbenchmarker/container_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ def _Build(self, image):
# Build the image remotely using an image building service.
self.RemoteBuild(image)
self.remote_build_times[image.name] = time.time() - build_start
return
except NotImplementedError:
pass

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,12 @@ def Run(benchmark_spec):
cluster = benchmark_spec.container_cluster
container_0 = cluster.containers['netperf'][0]
spec = benchmark_spec.container_specs['netperf']

output_selector = (
'THROUGHPUT,THROUGHPUT_UNITS,P50_LATENCY,P90_LATENCY,P99_LATENCY,'
'STDDEV_LATENCY,MIN_LATENCY,MAX_LATENCY,CONFIDENCE_ITERATION,'
'THROUGHPUT_CONFID'
)
spec.command = ['netperf',
'-t', 'TCP_STREAM',
'-H', container_0.ip_address,
'-l', '100',
'--',
'-o', output_selector]
'-o', netperf_benchmark.OUTPUT_SELECTOR]
cluster.DeployContainer('netperf', benchmark_spec.container_specs['netperf'])
container_1 = cluster.containers['netperf'][1]
container_1.WaitForExit()
Expand Down
15 changes: 10 additions & 5 deletions perfkitbenchmarker/linux_benchmarks/netperf_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@

MBPS = 'Mbits/sec'
TRANSACTIONS_PER_SECOND = 'transactions_per_second'
# Specifies the keys and to include in the results for OMNI tests.
# Any user of ParseNetperfOutput() (e.g. container_netperf_benchmark), must
# specify these selectors to ensure the parsing doesn't break.
OUTPUT_SELECTOR = (
'THROUGHPUT,THROUGHPUT_UNITS,P50_LATENCY,P90_LATENCY,'
'P99_LATENCY,STDDEV_LATENCY,MIN_LATENCY,MAX_LATENCY,'
'CONFIDENCE_ITERATION,THROUGHPUT_CONFID,'
'LOCAL_TRANSPORT_RETRANS,REMOTE_TRANSPORT_RETRANS')

# Command ports are even (id*2), data ports are odd (id*2 + 1)
PORT_START = 20000
Expand Down Expand Up @@ -332,15 +340,12 @@ def RunNetperf(vm, benchmark_name, server_ip, num_streams):
'-t {benchmark_name} -H {server_ip} -l {length} {confidence}'
' -- '
'-P ,{{data_port}} '
'-o THROUGHPUT,THROUGHPUT_UNITS,P50_LATENCY,P90_LATENCY,'
'P99_LATENCY,STDDEV_LATENCY,'
'MIN_LATENCY,MAX_LATENCY,'
'CONFIDENCE_ITERATION,THROUGHPUT_CONFID,'
'LOCAL_TRANSPORT_RETRANS,REMOTE_TRANSPORT_RETRANS').format(
'-o {output_selector}').format(
netperf_path=netperf.NETPERF_PATH,
benchmark_name=benchmark_name,
server_ip=server_ip,
length=FLAGS.netperf_test_length,
output_selector=OUTPUT_SELECTOR,
confidence=confidence, verbosity=verbosity)
if FLAGS.netperf_thinktime != 0:
netperf_cmd += (' -X {thinktime},{thinktime_array_size},'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def Push(self, image):
def RemoteBuild(self, image):
"""Build the image remotely."""
full_tag = self.GetFullRegistryTag(image.name)
build_cmd = util.GcloudCommand(self, 'container', 'builds', 'submit',
build_cmd = util.GcloudCommand(self, 'builds', 'submit',
'--tag', full_tag, image.directory)
del build_cmd.flags['zone']
build_cmd.Issue()
Expand Down

0 comments on commit 431b8e8

Please sign in to comment.