def RunTestOnLoader(vm, loader_index, operations_per_vm, data_node_ips,
                    command, user_operations, population_per_vm,
                    population_dist, population_params):
  if command == USER_COMMAND:
    command += ' profile={profile} ops\({ops}\)'.format(
        profile=TEMP_PROFILE_PATH, ops=user_operations)

    schema_option = ''
  else:
    if command == MIXED_COMMAND:
      command += ' ratio\({ratio}\)'.format(
          ratio=FLAGS.cassandra_stress_mixed_ratio)
    # TODO: Support more complex replication strategy.
    schema_option = '-schema replication\(factor={replication_factor}\)'.format(
        replication_factor=FLAGS.cassandra_stress_replication_factor)

  population_range = '%s..%s' % (loader_index * population_per_vm + 1,
                                 (loader_index + 1) * population_per_vm)
  if population_params:
    population_params = '%s,%s' % (population_range, population_params)
  else:
    population_params = population_range
  if population_dist:
    population_dist = '-pop dist=%s\(%s\)' % (population_dist,
                                              population_params)
  else:
    population_dist = '-pop seq=%s' % population_params
  vm.RobustRemoteCommand(
      '{cassandra} {command} cl={consistency_level} n={num_keys} '
      '-node {nodes} {schema} {population_dist} '
      '-log file={result_file} -rate threads={threads} '
      '-errors retries={retries}'.format(
          cassandra=cassandra.GetCassandraStressPath(vm),
          command=command,
          consistency_level=FLAGS.cassandra_stress_consistency_level,
          num_keys=operations_per_vm,
          nodes=','.join(data_node_ips),
          schema=schema_option,
          population_dist=population_dist,
          result_file=_ResultFilePath(vm),
          retries=FLAGS.cassandra_stress_retries,
          threads=FLAGS.num_cassandra_stress_threads))
Format a string using the string formatting operator and/or :func:`str.format()`.
dataset/ETHPy150Open GoogleCloudPlatform/PerfKitBenchmarker/perfkitbenchmarker/linux_benchmarks/cassandra_stress_benchmark.py/RunTestOnLoader--crossover with--dataset/ETHPy150Open xolox/python-humanfriendly/humanfriendly/text.py/format