original_docstring: Parse memtier_benchmark result textfile into samples.
  
    Args:
      memtier_results: Text output of running Memtier benchmark.
      meta: metadata associated with the results.
    Yields:
      List of sample.Sample objects.
  
    Example memtier_benchmark output, note Hits/sec and Misses/sec are displayed
    in error for version 1.2.8+ due to bug:
    https://github.com/RedisLabs/memtier_benchmark/issues/46
  
    4         Threads
    50        Connections per thread
    20        Seconds
    Type        Ops/sec     Hits/sec   Misses/sec      Latency       KB/sec
    ------------------------------------------------------------------------
    Sets        4005.50          ---          ---      4.50600       308.00
    Gets       40001.05         0.00     40001.05      4.54300      1519.00
    Totals     44006.55         0.00     40001.05      4.54000      1828.00
  
    Request Latency Distribution
    Type        <= msec      Percent
    ------------------------------------------------------------------------
    SET               0         9.33
    SET               1        71.07
    ...
    SET              33       100.00
    SET              36       100.00
    ---
    GET               0        10.09
    GET               1        70.88
    ..
    GET              40       100.00
    GET              41       100.00
    
docstring: Parse memtier_benchmark result textfile into samples.
docstring_tokens: Parse memtier_benchmark result textfile into samples .
code: def ParseResults(memtier_results, meta):
    """Parse memtier_benchmark result textfile into samples.
  
    Args:
      memtier_results: Text output of running Memtier benchmark.
      meta: metadata associated with the results.
    Yields:
      List of sample.Sample objects.
  
    Example memtier_benchmark output, note Hits/sec and Misses/sec are displayed
    in error for version 1.2.8+ due to bug:
    https://github.com/RedisLabs/memtier_benchmark/issues/46
  
    4         Threads
    50        Connections per thread
    20        Seconds
    Type        Ops/sec     Hits/sec   Misses/sec      Latency       KB/sec
    ------------------------------------------------------------------------
    Sets        4005.50          ---          ---      4.50600       308.00
    Gets       40001.05         0.00     40001.05      4.54300      1519.00
    Totals     44006.55         0.00     40001.05      4.54000      1828.00
  
    Request Latency Distribution
    Type        <= msec      Percent
    ------------------------------------------------------------------------
    SET               0         9.33
    SET               1        71.07
    ...
    SET              33       100.00
    SET              36       100.00
    ---
    GET               0        10.09
    GET               1        70.88
    ..
    GET              40       100.00
    GET              41       100.00
    """
    set_histogram = []
    get_histogram = []
    total_requests = FLAGS.memtier_requests
    approx_total_sets = round(float(total_requests) / (FLAGS.memtier_ratio + 1))
    last_total_sets = 0
    approx_total_gets = total_requests - approx_total_sets
    last_total_gets = 0
    for raw_line in memtier_results.splitlines():
      line = raw_line.strip()
  
      if re.match(r'^Totals', line):
        _, ops, _, _, _, kilobyte = line.split()
        yield sample.Sample('Ops Throughput', float(ops), 'ops/s', meta)
        yield sample.Sample('KB Throughput', float(kilobyte), 'KB/s', meta)
  
      last_total_sets = _ParseLine(
          r'^SET',
          line,
          approx_total_sets,
          last_total_sets,
          set_histogram)
  
      last_total_gets = _ParseLine(
          r'^GET',
          line,
          approx_total_gets,
          last_total_gets,
          get_histogram)
  
    for name, histogram in [('get', get_histogram), ('set', set_histogram)]:
      hist_meta = meta.copy()
      hist_meta.update({'histogram': json.dumps(histogram)})
      yield sample.Sample('{0} latency histogram'.format(name), 0, '', hist_meta)
code_tokens: def ParseResults ( memtier_results , meta ) : set_histogram = [ ] get_histogram = [ ] total_requests = FLAGS . memtier_requests approx_total_sets = round ( float ( total_requests ) / ( FLAGS . memtier_ratio + 1 ) ) last_total_sets = 0 approx_total_gets = total_requests - approx_total_sets last_total_gets = 0 for raw_line in memtier_results . splitlines ( ) : line = raw_line . strip ( ) if re . match ( r'^Totals' , line ) : _ , ops , _ , _ , _ , kilobyte = line . split ( ) yield sample . Sample ( 'Ops Throughput' , float ( ops ) , 'ops/s' , meta ) yield sample . Sample ( 'KB Throughput' , float ( kilobyte ) , 'KB/s' , meta ) last_total_sets = _ParseLine ( r'^SET' , line , approx_total_sets , last_total_sets , set_histogram ) last_total_gets = _ParseLine ( r'^GET' , line , approx_total_gets , last_total_gets , get_histogram ) for name , histogram in [ ( 'get' , get_histogram ) , ( 'set' , set_histogram ) ] : hist_meta = meta . copy ( ) hist_meta . update ( { 'histogram' : json . dumps ( histogram ) } ) yield sample . Sample ( '{0} latency histogram' . format ( name ) , 0 , '' , hist_meta )
short_docstring: Parse memtier_benchmark result textfile into samples.
short_docstring_tokens: Parse memtier_benchmark result textfile into samples .
comment: """Parse memtier_benchmark result textfile into samples.
  
    Args:
      memtier_results: Text output of running Memtier benchmark.
      meta: metadata associated with the results.
    Yields:
      List of sample.Sample objects.
  
    Example memtier_benchmark output, note Hits/sec and Misses/sec are displayed
    in error for version 1.2.8+ due to bug:
    https://github.com/RedisLabs/memtier_benchmark/issues/46
  
    4         Threads
    50        Connections per thread
    20        Seconds
    Type        Ops/sec     Hits/sec   Misses/sec      Latency       KB/sec
    ------------------------------------------------------------------------
    Sets        4005.50          ---          ---      4.50600       308.00
    Gets       40001.05         0.00     40001.05      4.54300      1519.00
    Totals     44006.55         0.00     40001.05      4.54000      1828.00
  
    Request Latency Distribution
    Type        <= msec      Percent
    ------------------------------------------------------------------------
    SET               0         9.33
    SET               1        71.07
    ...
    SET              33       100.00
    SET              36       100.00
    ---
    GET               0        10.09
    GET               1        70.88
    ..
    GET              40       100.00
    GET              41       100.00
    """