def CreateSamples(results, start_index, end_index, metadata,
                  field_index_mapping):
  samples = []
  for field_index in range(start_index, end_index):
    field_name = field_index_mapping[field_index]
    value = results[field_index]
    if not IsValueValid(value):
      continue
    if IsCpuField(field_name):
      unit = '%s'
    elif IsLatencyField(field_name):
      value, unit = ParseLatencyResult(value)
    else:
      unit = 'K/sec'
    samples.append(sample.Sample(field_name, float(value), unit, metadata))
  return samples
Create samples with data in results from start_index to end_index.
dataset/ETHPy150Open GoogleCloudPlatform/PerfKitBenchmarker/perfkitbenchmarker/linux_benchmarks/bonnie_benchmark.py/CreateSamples