mozilla

Development Streams

class heka.streams.dev.DebugCaptureStream(**kwargs)[source]

Captures up to 100 heka messages in a circular buffer for inspection later.

This is only for DEBUGGING. Do not use this for anything except development.

__weakref__

list of weak references to the object (if defined)

write(msg)[source]

Append object to the circular buffer.

class heka.streams.dev.FileStream(filepath)[source]

Emits messages to a filesystem file.

__weakref__

list of weak references to the object (if defined)

class heka.streams.dev.StdOutStream[source]

This is implemented as a class so that mocks can properly stub out sys.stdout

__weakref__

list of weak references to the object (if defined)

Production Streams

class heka.streams.udp.UdpStream(host, port)[source]

Sends heka messages out via a UDP socket.

__init__(host, port)[source]

Create UdpStream object.

Parameters:
  • host – A string or sequence of strings representing the hosts to which messages should be delivered.
  • port – An integer or sequence of integers representing the ports to which the messages should be delivered. Will be zipped w/ the provided hosts to generate host/port pairs. If there are extra hosts, the last port in the sequence will be repeated for each extra host. If there are extra ports they will be truncated and ignored.
__weakref__

list of weak references to the object (if defined)

write(data)[source]

Send bytes off to the heka listener(s).

Parameters:data – bytes to send to the listener
class heka.streams.tcp.TcpStream(host, port)[source]

Sends heka messages out via a TCP socket.

__init__(host, port)[source]

Create TcpStream object.

Parameters:
  • host – A string or sequence of strings representing the hosts to which messages should be delivered.
  • port – An integer or sequence of integers representing the ports to which the messages should be delivered. Will be zipped w/ the provided hosts to generate host/port pairs. If there are extra hosts, the last port in the sequence will be repeated for each extra host. If there are extra ports they will be truncated and ignored.
__weakref__

list of weak references to the object (if defined)

write(data)[source]

Send bytes off to the heka listener(s).

Parameters:data – bytes to send to the listener