API

Contents:

feedr.feedr.get_current_time()[source]

returns the current time (no microseconds tho)

feedr.feedr.calculate_throughput(elapsed_time, messages)[source]

calculates throughput and extracts the number of seconds for the run from the elapsed time

Parameters:
  • elapsed_time – run time
  • messages (int) – number of messages to write
Returns:

throughput and seconds

Return type:

tuple

feedr.feedr.send(instance, client, formatter, format_config, messages, gap, batch)[source]

sends data and prints the time it took to send it

Parameters:
  • instance – transport class instance
  • client – client to use to send send
  • format (string) – formatter to use
  • format_config (dict) – formatter configuration to use
  • messages (int) – number of messages to send
  • gap (float) – gap in seconds between 2 messages
  • batch (int) – number of messages per batch
feedr.feedr.config_transport(transports, transport, transport_config)[source]

returns a configured instance and client for the transport

Parameters:
  • transports – transport classes to choose from.
  • transport (string) – transport to use
  • transport_config (dict) – transport configuration
feedr.feedr.generator(config=None, transport=None, formatter=None, gap=None, messages=0, batch=1, verbose=False)[source]

generates data

this will generate data in the requested format and protocol.

Parameters:
  • config (string) – path to config file path
  • transport (string) – transport type to use
  • formatter (string) – formatter to use
  • gap (float) – gap in seconds between 2 messages
  • messages (int) – number of messages to send
  • batch (int) – number of messages to stack before sending
  • verbose (bool) – sets verbose state for internal logging.
feedr.feedr.list_fake_types()[source]

prints a list of random data types with an example

feedr.feedr.list_transports()[source]
feedr.feedr.list_formatters()[source]
exception feedr.feedr.FeedrError[source]

Bases: exceptions.Exception