コード例 #1
0
 def __init__(self,
              wk_type,
              instance_name,
              method='sysbench',
              num_metric=63,
              num_other_knobs=0):
     """Initialize `TencentServer` Class
     Args:
         instance_name: str, mysql instance name, get the database infomation
     """
     MySQLEnv.__init__(self, wk_type)
     # super(MySQLEnv, self).__init__()
     self.wk_type = wk_type
     self.score = 0.0
     self.num_metric = num_metric
     self.steps = 0
     self.terminate = False
     self.last_external_metrics = None
     self.instance_name = instance_name
     self.db_info = configs.instance_config[instance_name]
     self.url = self.db_info['server_url']
     self.alpha = 1.0
     self.method = method
     knobs.init_knobs(instance_name, num_other_knobs)
     self.default_knobs = knobs.get_init_knobs()
コード例 #2
0
 def __init__(self, wk_type, instance_name):
     MySQLEnv.__init__(self, wk_type)
     self.wk_type = wk_type
     self.score = 0.0
     self.steps = 0
     self.terminate = False
     self.last_external_metrics = None
     self.instance_name = instance_name
     self.db_info = configs.instance_config[instance_name]
     self.server_ip = self.db_info['host']
     self.alpha = 1.0
     knobs.init_knobs(instance_name, num_more_knobs=0)
     self.default_knobs = knobs.get_init_knobs()
コード例 #3
0
ファイル: myencoder.py プロジェクト: qiangxu1996/CodecTune
    def __init__(self, video, width, height, fps, num_metric=42):
        self.video = video
        self.width = width
        self.height = height
        self.fps = fps

        self.steps = 0
        self.score = 0.0
        self.terminate = False
        self.last_external_metrics = []
        self.default_externam_metrics = None
        self.num_metric = num_metric

        knobs.init_knobs(num_more_knobs=0)
        self.default_knobs = knobs.get_init_knobs()

        #create an x265 encoder
        encoder_create(self.width, self.height, self.fps)
コード例 #4
0
    def __init__(self,  instance, task_detail,model_detail,host):
        """Initialize `TencentServer` Class
        Args:
            instance_name: str, mysql instance name, get the database infomation
        """
        MySQLEnv.__init__(self, task_detail["rw_mode"])
        # super(MySQLEnv, self).__init__()
        self.wk_type = task_detail["rw_mode"]
        self.score = 0.0
        self.num_metric = model_detail["dimension"]
        self.steps = 0
        self.task_id = task_detail["task_id"]
        self.terminate = False
        self.last_external_metrics = None
        self.db_info = instance
        self.host = host
        self.alpha = 1.0
        self.method = task_detail["run_mode"]
        self.best_result = CONST.FILE_LOG_BEST % self.task_id
        self.threads = task_detail["threads"]

        knobs.init_knobs(instance,model_detail["knobs"])
        self.default_knobs = knobs.get_init_knobs()