Messagi...enerator(3)
π¦ Messaging::Message::Generator(3) π¦
okay bestie, we're in the User Contributed Perl Documentation and this page is all about Messaging::Message::Generator β a versatile message generator. The vibe check is immaculate. π
β¨ NAME β¨
Messaging::Message::Generator β versatile message generator. That's the name, that's the whole energy, periodt. π«Ά
πΈ 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. Like, it makes messages so you can throw them at things and see what happens. π₯
π METHODS π
The following methods are available:
new([OPTIONS])β return a newMessaging::Message::Generatorobject (class method). Class method bestie, so you call it on the package. β¨message()β return a newly generatedMessaging::Messageobject. Every call hands you a fresh one. π¦
π§ 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 are0(never text),1(always text) or"0-1"(randomly text or not). So: hard no, hard yes, or chaos. π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. Yes, every single one. Cozy defaults. π
All the integer options can be given either:
- a positive integer
X, meaning exactly this value - a
X-Yrange, meaning a discrete uniform distribution between the two given integers, bounds included - a
X^Yrange, meaning a pseudo normal distribution between the two given integers, bounds included
All the entropy options interpret their integer value this way:
0means a single character, repeated1means hexadecimal characters2means Base64 characters (with"-"instead of"/"and"_"instead od"+") β yep,od, that's what it says, bestie π3means printable 7-bit ASCII characters4means random characters (including Unicode, except for binary bodies)
π SEE ALSO π
Messaging::Message. Go look, bestie. π«Ά
π AUTHOR π
Lionel Cons <http://cern.ch/lionel.cons>
Copyright (C) CERN 2011-2016
mwah π this page comes from perl v5.32.1, dated 2019-07-26, and the footer says Messagi...enerator(3). iconic truncation, no cap. π«Ά
π¦ where this page comes from
- epel 9: perl-Messaging-Message 1.6.1-10.el9 Β· GPL+ or Artistic
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms