Messaging::Message::Generator - versatile message generator
use Messaging::Message::Generator; # create the generator $mg = Messaging::Message::Generator->new( "body-content" => "binary", "body-size" => 1024, ); # 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:
string specifying the body content type; depending on this value, the body will be made of:
only Base64 characters
anything
the message index number, starting at 1, optionally adjusted to match the body-size (this is the default)
body-size
only printable 7-bit ASCII characters
integer specifying the body size
integer specifying the number of header fields
integer specifying the size of each header field value (default is -32)
integer specifying the size of each header field name (default is -16)
string to prepend to all header field names (default is rnd-)
rnd-
Note: all integer options can be either positive (meaning exactly this value) or negative (meaning randomly distributed around the value).
For instance:
$mg = Messaging::Message::Generator->new( "header-count" => 10, "header-value-size" => -20, );
will generate messages with exactly 10 random header fields, each field value having a random size between 0 and 40 and normally distributed around 20.
Messaging::Message.
Lionel Cons http://cern.ch/lionel.cons
Copyright CERN 2011-2012
To install Messaging::Message, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Messaging::Message
CPAN shell
perl -MCPAN -e shell install Messaging::Message
For more information on module installation, please visit the detailed CPAN module installation guide.