
Messaging::Message::Generator - versatile message generator

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 ...
}

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

The following methods are available:
return a new Messaging::Message::Generator object (class method)
return a newly generated Messaging::Message object

When creating a message generator, the following options can be given:
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)
integer specifying the length of the body
integer specifying the entropy of the body
integer specifying the number of header fields
string to prepend to each header field name
integer specifying the length of each header field name (prefix not included)
integer specifying the entropy of each header field name
string to prepend to each header field value
integer specifying the length of each header field value (prefix not included)
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:
X, meaning exactly this valueX-Y range, meaning a discrete uniform distribution between the two given integers, bounds includedX^Y range, meaning a pseudo normal distribution between the two given integers, bounds includedAll the entropy options interpret their integer value this way:
0 means a single character, repeated1 means hexadecimal characters2 means Base64 characters (with - instead of / and _ instead od +)3 means printable 7-bit ASCII characters4 means random characters (including Unicode, except for binary bodies)

Lionel Cons http://cern.ch/lionel.cons
Copyright CERN 2011-2012