Ejemplo n.º 1
0
    def __init__(self, benchmark_name):
        Benchmark.__init__(self, name=benchmark_name)
        self.benchmark_name = benchmark_name
        bench_dict = all_benchmarks[benchmark_name]

        benchmark_name = bench_dict["benchmark"]
        preset_options = ";".join(
            "%s=%s" % (key, value)
            for key, value in bench_dict.get("options", {}).items())

        self.cmd_time_parameter = self.phoronixcmd_timed % (
            preset_options, "%s", benchmark_name)
Ejemplo n.º 2
0
 def __init__(self,
              threads_count=None,
              connection_per_transaction=None,
              output_log=None,
              scale_factor=None):
     Benchmark.__init__(self)
     self.threads_count = parameter_int(threads_count, 150)
     self.connection_per_transaction = parameter_bool(
         connection_per_transaction, False)
     self.output_log = parameter_bool(output_log, False)
     self.scale_factor = parameter_int(scale_factor, 200)
     self._initialized = False
Ejemplo n.º 3
0
    def __init__(self,
                 keys_dist=None,
                 vals_dist=None,
                 cmd_get_percent=None,
                 win_size=None,
                 seed=None,
                 stats_frequency=5,
                 mode='remote',
                 memslap_cmd='memaslap'):
        """
        keys_dist, vals_dist: key/value distribution
        cmd_get_percent: gets percent (from total requests)
        win_size: window size
        seed: seed for memslap
        stats_frequency: stats output frequency (seconds)
        mode: 'remote' - run on guest, 'local' - run on host
        memslap_cmd: testing the new version of memslap (1.0.17), where the similar one is called mem*a*slap
        """
        Benchmark.__init__(self, is_remote=(mode.lower() == 'remote'))

        config = []
        if keys_dist is not None:
            config.extend(['key', *("%i %i %.1f" % tpl for tpl in keys_dist)])

        if vals_dist is not None:
            config.extend(
                ['value', *("%i %i %.1f" % tpl for tpl in vals_dist)])

        if cmd_get_percent is not None:
            config.extend([
                'cmd', f'0 {1 - cmd_get_percent:.1f}',
                f'1 {cmd_get_percent:.1f}'
            ])

        if config:
            config.append('')
            self.config_str = "\n".join(config)
        else:
            self.config_str = None
        self._config_file_name = None

        self.win_size = win_size

        self.seed = seed
        self.stats_frequency = stats_frequency
        self._memslap_cmd = memslap_cmd
Ejemplo n.º 4
0
 def __init__(self):
     Benchmark.__init__(self)
     self.mc_client = None
Ejemplo n.º 5
0
 def __init__(self):
     Benchmark.__init__(self)
Ejemplo n.º 6
0
 def __init__(self, mode='remote'):
     Benchmark.__init__(self, is_remote=(mode == 'remote'))
Ejemplo n.º 7
0
 def __init__(self, benchmark: str):
     if benchmark not in BENCHMARKS:
         raise ValueError(f"Benchmark '{benchmark}' does not exit.")
     self.benchmark = benchmark
     Benchmark.__init__(self, is_remote=True, name=benchmark)
Ejemplo n.º 8
0
 def __init__(self):
     Benchmark.__init__(self, is_remote=True)