예제 #1
0
def run():
  # For the stream "num_per_bucket" timewidth_seconds is 1000 and
  # num_shards is 1, so all of these inserts go into the same bucket. On each
  # iteration we adds 200k more events to the same bucket and then read 10k
  # events to see how much slower reading is now. Overall we insert 2m events
  # in batches on 200k each.
  for n in xrange(200000, 2200000, 200000):
    insert('num_per_bucket', 200000)
    timeit('n=%s' % n, read, 'num_per_bucket', 10000, start=500)
예제 #2
0
def run():
    # For the stream "num_per_bucket" timewidth_seconds is 1000 and
    # num_shards is 1, so all of these inserts go into the same bucket. On each
    # iteration we adds 200k more events to the same bucket and then read 10k
    # events to see how much slower reading is now. Overall we insert 2m events
    # in batches on 200k each.
    for n in xrange(200000, 2200000, 200000):
        insert('num_per_bucket', 200000)
        timeit('n=%s' % n, read, 'num_per_bucket', 10000, start=500)
예제 #3
0
def run():
  # Each event is ~181 bytes.
  for num_threads in (1, 5, 10):
    print '  * %s thread(s).' % num_threads
    for chunk_size in (500, 1000, 5000, 10000):
      stream = 'insert_%s' % chunk_size
      num_events_per_thread = 100000 / num_threads
      def execute():
        greenlets = [gevent.spawn(insert, stream, num_events_per_thread,
                                  chunk_size=chunk_size)
                     for _ in xrange(num_threads)]
        gevent.joinall(greenlets)
      timeit('chunk_size=%s' % chunk_size, execute)
예제 #4
0
def run():
    # Each event is ~181 bytes.
    for num_threads in (1, 5, 10):
        print '  * %s thread(s).' % num_threads
        for chunk_size in (500, 1000, 5000, 10000):
            stream = 'insert_%s' % chunk_size
            num_events_per_thread = 100000 / num_threads

            def execute():
                greenlets = [
                    gevent.spawn(insert,
                                 stream,
                                 num_events_per_thread,
                                 chunk_size=chunk_size)
                    for _ in xrange(num_threads)
                ]
                gevent.joinall(greenlets)

            timeit('chunk_size=%s' % chunk_size, execute)
예제 #5
0
def run():
    for n in xrange(5000, 30000, 5000):
        stream = "read_size_%d" % n
        insert(stream, 100000)
        timeit("read_size=%d" % n, read, stream, 100000)
예제 #6
0
def run():
  for n in (1, 3, 6, 12, 24):
    stream = 'shards_%s' % n
    insert(stream, 200000)
    timeit('shards=%s' % n, read, stream, 150000)