Beispiel #1
0
 def initImpl(self, config, data):
     # HACK: Collapse config into a single dict
     new_config = { }
     for s in config.keys():
         if not s in ['default', self.name]: continue
         for k in config[s].keys():
             new_config[k] = config[s][k]
     config = new_config
     
     ## Create a handle to the target client driver
     config['system'] = "mongodb"
     realpath = os.path.realpath(__file__)
     basedir = os.path.dirname(realpath)
     if not os.path.exists(realpath):
         cwd = os.getcwd()
         basename = os.path.basename(realpath)
         if os.path.exists(os.path.join(cwd, basename)):
             basedir = cwd
     config['ddl'] = os.path.join(basedir, "tpcc.sql")
     
     ## Create our ScaleParameter stuff that we're going to need
     num_warehouses = int(config['warehouses'])
     self.scaleParameters = scaleparameters.makeWithScaleFactor(num_warehouses, config["scalefactor"])
     
     driverClass = self.createDriverClass(config['system'])
     assert driverClass != None, "Failed to find '%s' class" % config['system']
     driver = driverClass(self.conn, config['ddl'])
     assert driver != None, "Failed to create '%s' driver" % config['system']
     driver.loadConfig(config)
     self.driver = driver
     
     self.executor = executor.Executor(self.scaleParameters, stop_on_error=self.stop_on_error)
Beispiel #2
0
    def initImpl(self, config, data):
        # HACK: Collapse config into a single dict
        new_config = {}
        for s in config.keys():
            if not s in ['default', self.name]: continue
            for k in config[s].keys():
                new_config[k] = config[s][k]
        config = new_config

        ## Create a handle to the target client driver
        config['system'] = "mongodb"
        realpath = os.path.realpath(__file__)
        basedir = os.path.dirname(realpath)
        if not os.path.exists(realpath):
            cwd = os.getcwd()
            basename = os.path.basename(realpath)
            if os.path.exists(os.path.join(cwd, basename)):
                basedir = cwd
        config['ddl'] = os.path.join(basedir, "tpcc.sql")

        ## Create our ScaleParameter stuff that we're going to need
        num_warehouses = int(config['warehouses'])
        self.scaleParameters = scaleparameters.makeWithScaleFactor(
            num_warehouses, config["scalefactor"])

        driverClass = self.createDriverClass(config['system'])
        assert driverClass != None, "Failed to find '%s' class" % config[
            'system']
        driver = driverClass(self.conn, config['ddl'])
        assert driver != None, "Failed to create '%s' driver" % config['system']
        driver.loadConfig(config)
        self.driver = driver

        self.executor = executor.Executor(self.scaleParameters,
                                          stop_on_error=self.stop_on_error)
 def initImpl(self, config, channels):
     ## Create our ScaleParameter stuff that we're going to need
     num_warehouses = int(config[self.name]['warehouses'])
     self.scaleParameters = scaleparameters.makeWithScaleFactor(num_warehouses, config['default']["scalefactor"])
     return dict([(channels[i], None) for i in xrange(len(channels))])
Beispiel #4
0
 def initImpl(self, config, channels):
     ## Create our ScaleParameter stuff that we're going to need
     num_warehouses = int(config[self.name]['warehouses'])
     self.scaleParameters = scaleparameters.makeWithScaleFactor(
         num_warehouses, config['default']["scalefactor"])
     return dict([(channels[i], None) for i in xrange(len(channels))])