pub struct TestConfig {
pub message_count: Option<u32>,
pub max_messages_per_second: Option<u32>,
pub seed: Option<u32>,
pub message_size: Option<u32>,
pub send_batch_on_register: Option<bool>,
pub dummy_fields: Option<DummyFields>,
}
Expand description
The configuration for a fake producer used in tests.
Fields§
§message_count: Option<u32>
The number of messages the fake producer should send.
max_messages_per_second: Option<u32>
The maximum number of messages which should be sent each second. The actual obserced speed may be lower if the producer is unable to work fast enough. If this is zero or unset, the producer will send as fast as possible.
seed: Option<u32>
The seed value for a simple multiplicative congruential pseudo-random number sequence.
message_size: Option<u32>
The size of each message in bytes. Should be greater than or equal 5 to account for the number of bytes needed to encode the random number and a null byte for the string.
send_batch_on_register: Option<bool>
Whether the producer should send a event batch when the data source is is initially registered.
dummy_fields: Option<DummyFields>
Implementations§
Source§impl TestConfig
impl TestConfig
Sourcepub fn message_count(&self) -> u32
pub fn message_count(&self) -> u32
Returns the value of message_count
, or the default value if message_count
is unset.
Sourcepub fn max_messages_per_second(&self) -> u32
pub fn max_messages_per_second(&self) -> u32
Returns the value of max_messages_per_second
, or the default value if max_messages_per_second
is unset.
Sourcepub fn message_size(&self) -> u32
pub fn message_size(&self) -> u32
Returns the value of message_size
, or the default value if message_size
is unset.
Sourcepub fn send_batch_on_register(&self) -> bool
pub fn send_batch_on_register(&self) -> bool
Returns the value of send_batch_on_register
, or the default value if send_batch_on_register
is unset.
Trait Implementations§
Source§impl Clone for TestConfig
impl Clone for TestConfig
Source§fn clone(&self) -> TestConfig
fn clone(&self) -> TestConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for TestConfig
impl Debug for TestConfig
Source§impl Default for TestConfig
impl Default for TestConfig
Source§impl Message for TestConfig
impl Message for TestConfig
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
Source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
Source§fn decode<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
.