bst-vs-heap 460 B

123456789101112131415161718
  1. #!/usr/bin/env python3
  2. import common
  3. parser = common.get_argparse(
  4. argparse_args={'description':'Convert a BST vs heap stat file into a gnuplot input'}
  5. )
  6. args = common.setup(parser)
  7. stats = common.get_stats()
  8. it = iter(stats)
  9. i = 1
  10. for stat in it:
  11. try:
  12. next_stat = next(it)
  13. except StopIteration:
  14. # Automatic dumpstats at end may lead to odd number of stats.
  15. break
  16. print('{} {} {}'.format(i, stat, next_stat))
  17. i += 1