haigha_perf.py
def _handleAlternatingPubConsumeTest(args):
  """ Parse args and invoke the alternating publish-consume test using the
  requested connection class

  :param args: sequence of commandline args passed after the "altpubcons"
    keyword
  """
  helpString = (
    "\n"
    "\t%prog publish OPTIONS\n"
    "\t%prog publish --help\n"
    "\t%prog --help\n"
    "\n"
    "Alternates publishing/consuming the given number of messages of the\n"
    "given size one message at a time via default exchange using the\n"
    "specified haigha interface")

  parser = OptionParser(helpString)

  implChoices = [
    "SocketTransport",    # Blocking socket transport
  ]

  parser.add_option(
      "--impl",
      action="store",
      type="choice",
      dest="impl",
      choices=implChoices,
      help=("Selection of haigha transport "
            "[REQUIRED; must be one of: %s]" % ", ".join(implChoices)))

  parser.add_option(
      "--msgs",
      action="store",
      type="int",
      dest="numMessages",
      default=1000,
      help="Number of messages to send [default: %default]")

  parser.add_option(
      "--size",
      action="store",
      type="int",
      dest="messageSize",
      default=1024,
      help="Size of each message in bytes [default: %default]")

  parser.add_option(
    "--conacks",
    action="store_true",
    dest="useConsumerAcks",
    default=False,
    help=("Configure consumer with noack=False and ack consumed messages "
          "one-at-a-time [defaults to OFF]"))

  parser.add_option(
      "--pubacks",
      action="store_true",
      dest="deliveryConfirmation",
      default=False,
      help="Publish in delivery confirmation mode [defaults to OFF]")

  options, positionalArgs = parser.parse_args(sys.argv[2:])

  if positionalArgs:
    raise parser.error("Unexpected to have any positional args, but got: %r"
                       % positionalArgs)

  if not options.impl:
    parser.error("--impl is required")

  if options.impl == "SocketTransport":
    runBlockingSocketAltPubConsumeTest(
      implClassName=options.impl,
      numMessages=options.numMessages,
      messageSize=options.messageSize,
      useConsumerAcks=options.useConsumerAcks,
      deliveryConfirmation=options.deliveryConfirmation)
  else:
    parser.error("unexpected impl=%r" % (options.impl,))
 Parse args and invoke the alternating publish-consume test using the
  requested connection class

  :param args: sequence of commandline args passed after the "altpubcons"
    keyword
  
Parse args and invoke the alternating publish-consume test using the
requested connection class
Parse args and invoke the alternating publish - consume test using the requested connection class
def _handleAlternatingPubConsumeTest(args):
  helpString = (
    "\n"
    "\t%prog publish OPTIONS\n"
    "\t%prog publish --help\n"
    "\t%prog --help\n"
    "\n"
    "Alternates publishing/consuming the given number of messages of the\n"
    "given size one message at a time via default exchange using the\n"
    "specified haigha interface")
  parser = OptionParser(helpString)
  implChoices = [
    "SocketTransport",    
  ]
  parser.add_option(
      "--impl",
      action="store",
      type="choice",
      dest="impl",
      choices=implChoices,
      help=("Selection of haigha transport "
            "[REQUIRED; must be one of: %s]" % ", ".join(implChoices)))
  parser.add_option(
      "--msgs",
      action="store",
      type="int",
      dest="numMessages",
      default=1000,
      help="Number of messages to send [default: %default]")
  parser.add_option(
      "--size",
      action="store",
      type="int",
      dest="messageSize",
      default=1024,
      help="Size of each message in bytes [default: %default]")
  parser.add_option(
    "--conacks",
    action="store_true",
    dest="useConsumerAcks",
    default=False,
    help=("Configure consumer with noack=False and ack consumed messages "
          "one-at-a-time [defaults to OFF]"))
  parser.add_option(
      "--pubacks",
      action="store_true",
      dest="deliveryConfirmation",
      default=False,
      help="Publish in delivery confirmation mode [defaults to OFF]")
  options, positionalArgs = parser.parse_args(sys.argv[2:])
  if positionalArgs:
    raise parser.error("Unexpected to have any positional args, but got: %r"
                       % positionalArgs)
  if not options.impl:
    parser.error("--impl is required")
  if options.impl == "SocketTransport":
    runBlockingSocketAltPubConsumeTest(
      implClassName=options.impl,
      numMessages=options.numMessages,
      messageSize=options.messageSize,
      useConsumerAcks=options.useConsumerAcks,
      deliveryConfirmation=options.deliveryConfirmation)
  else:
    parser.error("unexpected impl=%r" % (options.impl,))
def _handleAlternatingPubConsumeTest ( args ) : helpString = ( "\n" "\t%prog publish OPTIONS\n" "\t%prog publish --help\n" "\t%prog --help\n" "\n" "Alternates publishing/consuming the given number of messages of the\n" "given size one message at a time via default exchange using the\n" "specified haigha interface" ) parser = OptionParser ( helpString ) implChoices = [ "SocketTransport" , ] parser . add_option ( "--impl" , action = "store" , type = "choice" , dest = "impl" , choices = implChoices , help = ( "Selection of haigha transport " "[REQUIRED; must be one of: %s]" % ", " . join ( implChoices ) ) ) parser . add_option ( "--msgs" , action = "store" , type = "int" , dest = "numMessages" , default = 1000 , help = "Number of messages to send [default: %default]" ) parser . add_option ( "--size" , action = "store" , type = "int" , dest = "messageSize" , default = 1024 , help = "Size of each message in bytes [default: %default]" ) parser . add_option ( "--conacks" , action = "store_true" , dest = "useConsumerAcks" , default = False , help = ( "Configure consumer with noack=False and ack consumed messages " "one-at-a-time [defaults to OFF]" ) ) parser . add_option ( "--pubacks" , action = "store_true" , dest = "deliveryConfirmation" , default = False , help = "Publish in delivery confirmation mode [defaults to OFF]" ) options , positionalArgs = parser . parse_args ( sys . argv [ 2 : ] ) if positionalArgs : raise parser . error ( "Unexpected to have any positional args, but got: %r" % positionalArgs ) if not options . impl : parser . error ( "--impl is required" ) if options . impl == "SocketTransport" : runBlockingSocketAltPubConsumeTest ( implClassName = options . impl , numMessages = options . numMessages , messageSize = options . messageSize , useConsumerAcks = options . useConsumerAcks , deliveryConfirmation = options . deliveryConfirmation ) else : parser . error ( "unexpected impl=%r" % ( options . impl , ) )
Parse args and invoke the alternating publish-consume test using the
requested connection class
Parse args and invoke the alternating publish - consume test using the requested connection class
""" Parse args and invoke the alternating publish-consume test using the
  requested connection class

  :param args: sequence of commandline args passed after the "altpubcons"
    keyword
  """ # Blocking socket transport
args
sequence of commandline args passed after the "altpubcons"
keyword
sequence of commandline args passed after the " altpubcons " keyword