def Prepare(benchmark_spec):
    """Install Redis on one VM and memtier_benchmark on another.

  Args:
    benchmark_spec: The benchmark specification. Contains all data that is
        required to run the benchmark.
  """
    client_vms = benchmark_spec.vm_groups['clients']
    server_vms = benchmark_spec.vm_groups['servers']
    vm_util.RunThreaded(_InstallRedisEnterprise, client_vms + server_vms)

    server_vm = server_vms[0]
    server_vm.AllowPort(REDIS_PORT)
    server_vm.AllowPort(REDIS_UI_PORT)

    redis_enterprise.OfflineCores(server_vms)
    redis_enterprise.CreateCluster(server_vms)

    # Skip preparing the database if we're optimizing throughput. The database
    # will be prepared on each individual run.
    if _OPTIMIZE_THROUGHPUT.value:
        return

    redis_enterprise.TuneProxy(server_vm)
    redis_enterprise.CreateDatabase(server_vms, REDIS_PORT)
    redis_enterprise.PinWorkers(server_vms)
    redis_enterprise.WaitForDatabaseUp(server_vm, REDIS_PORT)
    redis_enterprise.LoadDatabase(server_vms, client_vms, REDIS_PORT)
Ejemplo n.º 2
0
def Prepare(benchmark_spec):
    """Install Redis on one VM and memtier_benchmark on another.

  Args:
    benchmark_spec: The benchmark specification. Contains all data that is
        required to run the benchmark.
  """
    client_vms = benchmark_spec.vm_groups['clients']
    server_vms = benchmark_spec.vm_groups['servers']
    vm_util.RunThreaded(_InstallRedisEnterprise, client_vms + server_vms)

    server_vm = server_vms[0]
    server_vm.AllowPort(REDIS_PORT)
    server_vm.AllowPort(REDIS_UI_PORT)

    redis_enterprise.OfflineCores(server_vms)
    redis_enterprise.CreateCluster(server_vms)
    redis_enterprise.TuneProxy(server_vms)
    redis_enterprise.CreateDatabase(server_vms, REDIS_PORT)
    redis_enterprise.PinWorkers(server_vms)
    redis_enterprise.WaitForDatabaseUp(server_vm, REDIS_PORT)
    redis_enterprise.LoadDatabase(server_vms, client_vms, REDIS_PORT)