def RunTestOnLoader(vm, loader_index, operations_per_vm, data_node_ips,
                    command, user_operations, population_per_vm,
                    population_dist, population_params):
  """Run Cassandra-stress test on loader node.

  Args:
    vm: The target vm.
    loader_index: integer. The index of target vm in loader vms.
    operations_per_vm: integer. The number of operations each loader vm
        requests.
    data_node_ips: list. List of IP addresses for all data nodes.
    command: string. The cassandra-stress command to use.
    user_operations: string. The operations to use with user mode.
    population_per_vm: integer. Population per loader vm.
    population_dist: string. The population distribution.
    population_params: string. Representing additional population parameters.
  """
  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))
dataset/ETHPy150Open GoogleCloudPlatform/PerfKitBenchmarker/perfkitbenchmarker/linux_benchmarks/cassandra_stress_benchmark.py/RunTestOnLoader/operator `%` -> `-`