Lionel Cons > Messaging-Message > Messaging::Message::Generator

Download:
Messaging-Message-1.5.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 1.5   Source  

NAME ^

Messaging::Message::Generator - versatile message generator

SYNOPSIS ^

  use Messaging::Message::Generator;

  # create the generator
  $mg = Messaging::Message::Generator->new(
      "text"                 => "0-1",
      "body-length"          => "0-1000",
      "body-entropy"         => "1-4",
      "header-count"         => "2^6",
      "header-name-length"   => "10-20",
      "header-name-entropy"  => "1-2",
      "header-name-prefix"   => "rnd-",
      "header-value-length"  => "20-40",
      "header-value-entropy" => "0-3",
  );

  # use it to generate 10 messages
  foreach (1 .. 10) {
      $msg = $mg->message();
      ... do something with it ...
  }

DESCRIPTION ^

This module provides a versatile message generator that can be useful for stress testing or benchmarking messaging brokers or libraries.

METHODS ^

The following methods are available:

new([OPTIONS])

return a new Messaging::Message::Generator object (class method)

message()

return a newly generated Messaging::Message object

OPTIONS ^

When creating a message generator, the following options can be given:

text

integer specifying if the body is text string (as opposed to binary string) or not; supported values are 0 (never text), 1 (always text) or 0-1 (randomly text or not)

body-length

integer specifying the length of the body

body-entropy

integer specifying the entropy of the body

header-count

integer specifying the number of header fields

header-name-prefix

string to prepend to each header field name

header-name-length

integer specifying the length of each header field name (prefix not included)

header-name-entropy

integer specifying the entropy of each header field name

header-value-prefix

string to prepend to each header field value

header-value-length

integer specifying the length of each header field value (prefix not included)

header-value-entropy

integer specifying the entropy of each header field value

All the options default to 0 or the empty string.

All the integer options can be given either:

All the entropy options interpret their integer value this way:

SEE ALSO ^

Messaging::Message.

AUTHOR ^

Lionel Cons http://cern.ch/lionel.cons

Copyright (C) CERN 2011-2013

syntax highlighting: