Messagi...enerator(3)

πŸ“¦ version 1.6.1, in epel 9

πŸ¦‹ 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 new Messaging::Message::Generator object (class method). Class method bestie, so you call it on the package. ✨
  • message() β€” return a newly generated Messaging::Message object. 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 are 0 (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-Y range, meaning a discrete uniform distribution between the two given integers, bounds included
  • a X^Y range, meaning a pseudo normal distribution between the two given integers, bounds included

All the entropy options interpret their integer value this way:

  • 0 means a single character, repeated
  • 1 means hexadecimal characters
  • 2 means Base64 characters (with "-" instead of "/" and "_" instead od "+") β€” yep, od, that's what it says, bestie πŸ’€
  • 3 means printable 7-bit ASCII characters
  • 4 means 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