Skip to content

Instantly share code, notes, and snippets.

@ek-nath
Created July 21, 2014 07:53
Show Gist options
  • Select an option

  • Save ek-nath/5ee3b7a980784089b4ff to your computer and use it in GitHub Desktop.

Select an option

Save ek-nath/5ee3b7a980784089b4ff to your computer and use it in GitHub Desktop.

Revisions

  1. ek-nath created this gist Jul 21, 2014.
    14 changes: 14 additions & 0 deletions pub.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    from datetime import datetime
    import librarbbitmq

    msg = 'x'*20000
    M_PROP = {'delivery_mode': 1}
    connection = librabbitmq.connecetion(...)
    channel = connection.channel()
    start = datetime.now()
    for _ in xrange(count):
    connection._basic_publish(1, msg, X, RK, M_PROP, False, False)
    end1 = datetime.now()
    channel.close()
    end2 = datetime.now()
    print end1-start, end2-start