## -*- mode: python; coding: utf-8 -*-

include("http.conf")
DESCRIPTION="HTTP get latency with competing TCP stream"
DEFAULTS={'PLOT': 'totals'}
TOTAL_LENGTH=LENGTH+2*DELAY

DATA_SETS['TCP upload'] = {'command': find_netperf("TCP_STREAM", LENGTH, HOST),
                           'delay': DELAY,
                           'units': 'Mbits/s',
                           'runner': 'netperf_demo',}
DATA_SETS['HTTP latency']['command'] = find_http_getter(STEP_SIZE, TOTAL_LENGTH)

PLOTS['bandwidth'] = {'description': 'TCP bandwidth plot',
      'type': 'timeseries',
      'series': [{'data': 'TCP upload',
                  'label': 'TCP upload'},]}
PLOTS['totals'] = {'description': 'TCP bandwidth with delay and jitter',
                   'type': 'meta',
                   'subplots': ('bandwidth', 'http_delay')}
PLOTS['http_delay_cdf']['cutoff'] = (DELAY,DELAY)
PLOTS['box_combine'] = {'description': 'Box combination of HTTP latency and TCP bandwidth',
                        'type': 'box_combine',
                        'axis_labels': ['Mean bandwidth (MBits/s)', 'Mean download time (ms)'],
                        'dual_axes': True,
                        'series': [
                            {'data': 'TCP upload',
                                    'label': 'TCP Upload',
                                    'combine_mode': 'meta:MEAN_VALUE'},
                            {'data': 'HTTP latency',
                                    'label': 'HTTP get (ms)',
                                    'combine_mode': 'mean',
                                    'axis': 2}]}

PLOTS['cdf_combine'] = {'description': 'CDF combination of HTTP latency',
                        'type': 'cdf_combine',
                        'axis_labels': ['Mean download time (ms)'],
                        'series': [
                            {'data': 'HTTP latency',
                                    'label': 'HTTP get (ms)',
                                    'combine_mode': 'mean'}]}
PLOTS['bar_combine'] = {'description': 'Bar combination of HTTP latency',
                        'type': 'bar_combine',
                        'group_by': 'both',
                        'colour_by': 'series',
                        'axis_labels': ['Mean fetch time (ms)'],
                        'series': [
                            {'data': 'HTTP latency',
                                    'label': 'HTTP get (ms)',
                                    'combine_mode': 'mean'}]}

include("common.inc")
