Пример #1
0
 def __call__(self):
     grinder.logger.output('Selecting dataset from %s' % dataset_list)
     dataset_url = random.choice(data_urls.load_dataset_list(dataset_list))
     grinder.logger.output('Downloading %s' % dataset_url)
     result = streamed_get(dataset_url)
     grinder.logger.output('Transfered %d bytes' % result)
Пример #2
0
from net.grinder.script.Grinder import grinder

from dapbench.jython.util import generate_subset_requests
from dapbench.jython.netcdf import Dataset

import data_urls

properties = grinder.properties.getPropertySubset('dapbench.')

variable = properties['variable']
datasets = properties['datasets']
time_len = int(properties['time_len'])
req_sample_size = int(properties['req_sample_size'])

partition_dict = {'time': time_len}
dataset_list = data_urls.load_dataset_list(datasets)

test = Test(1, "Parallel slice request")
def call_request(req):
    return req()
test.record(call_request)

class TestRunner(object):
    def __init__(self):
        self.thread = grinder.getThreadNumber()
        # Select random dataset
        #!TODO: select dataset by Thread number?
        self.dataset_url = random.choice(dataset_list)
        self.ds = Dataset(self.dataset_url)
        self.variable = self.ds.variables[variable]
        self.requests = generate_subset_requests(self.variable,
Пример #3
0
from dapbench.jython.util import generate_subset_requests
from dapbench.jython.netcdf import Dataset

properties = grinder.properties.getPropertySubset('dapbench.')

#
# Select a dataset to test.  This selection is specific to the
# BADC test server.  Adapt to suite your test server.
#
import data_urls

# The BADC test datasets contain variable 'ta' with 1440 timepoints
variable = properties['variable']
dataset_list = properties['datasets']

dataset_url = random.choice(data_urls.load_dataset_list(dataset_list))
ds = Dataset(dataset_url)
variable = ds.variables[variable]

#
# partitions dictate into how many slices each run will divide the request
#
partitions = [int(x) for x in properties['partitions'].split(',')]


class Instrumented(object):
    next_test = 1
    def __init__(self, partition):
        grinder.logger.output('Selected dataset %s' % dataset_url)

        self.test = Test(Instrumented.next_test, 
Пример #4
0
 def __call__(self):
     grinder.logger.output('Selecting dataset from %s' % dataset_list)
     dataset_url = random.choice(data_urls.load_dataset_list(dataset_list))
     grinder.logger.output('Downloading %s' % dataset_url)
     result = streamed_get(dataset_url)
     grinder.logger.output('Transfered %d bytes' % result)
Пример #5
0
from dapbench.jython.util import generate_subset_requests
from dapbench.jython.netcdf import Dataset

properties = grinder.properties.getPropertySubset('dapbench.')

#
# Select a dataset to test.  This selection is specific to the
# BADC test server.  Adapt to suite your test server.
#
import data_urls

# The BADC test datasets contain variable 'ta' with 1440 timepoints
variable = properties['variable']
dataset_list = properties['datasets']

dataset_url = random.choice(data_urls.load_dataset_list(dataset_list))
ds = Dataset(dataset_url)
variable = ds.variables[variable]

#
# partitions dictate into how many slices each run will divide the request
#
partitions = [int(x) for x in properties['partitions'].split(',')]


class Instrumented(object):
    next_test = 1

    def __init__(self, partition):
        grinder.logger.output('Selected dataset %s' % dataset_url)