Exemple #1
0
def Run(benchmark_spec):
    """Run netperf TCP_STREAM between containers.

  Args:
    benchmark_spec: The benchmark specification. Contains all data that is
        required to run the benchmark.

  Returns:
    A list of sample.Sample objects.
  """
    samples = []
    cluster = benchmark_spec.container_cluster
    container_0 = cluster.containers['netperf'][0]
    spec = benchmark_spec.container_specs['netperf']
    spec.command = [
        'netperf', '-t', 'TCP_STREAM', '-H', container_0.ip_address, '-l',
        '100', '--', '-m',
        str(FLAGS.container_netperf_tcp_stream_send_size_in_bytes), '-o',
        netperf_benchmark.OUTPUT_SELECTOR
    ]
    cluster.DeployContainer('netperf',
                            benchmark_spec.container_specs['netperf'])
    container_1 = cluster.containers['netperf'][1]
    container_1.WaitForExit()
    throughput_sample, _, _ = netperf_benchmark.ParseNetperfOutput(
        container_1.GetLogs(), {}, 'TCP_STREAM', False)
    samples.append(throughput_sample)
    return samples
def Run(benchmark_spec):
    """Run netperf TCP_STREAM between containers.

  Args:
    benchmark_spec: The benchmark specification. Contains all data that is
        required to run the benchmark.

  Returns:
    A list of sample.Sample objects.
  """
    samples = []
    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
    ]
    cluster.DeployContainer('netperf',
                            benchmark_spec.container_specs['netperf'])
    container_1 = cluster.containers['netperf'][1]
    container_1.WaitForExit()
    throughput_sample, _, _ = netperf_benchmark.ParseNetperfOutput(
        container_1.GetLogs(), {}, 'TCP_STREAM', False)
    samples.append(throughput_sample)
    return samples
Exemple #3
0
 def testParseNetperfOutputError(self, output):
     with self.assertRaises(errors.Benchmarks.KnownIntermittentError) as e:
         netperf_benchmark.ParseNetperfOutput(output, {},
                                              'fake_benchmark_name', False)
     self.assertIn('Failed to parse stdout', str(e.exception))