# Path: duct/protocol/riemann.py
# class RiemannProtobufMixin(object):
# class RiemannProtocol(Int32StringReceiver, RiemannProtobufMixin):
# class RiemannClientFactory(protocol.ReconnectingClientFactory):
# class RiemannUDP(DatagramProtocol, RiemannProtobufMixin):
#     def __init__(self):
#     def encodeEvent(self, event):
#     def encodeMessage(self, events):
#     def decodeMessage(self, data):
#     def sendEvents(self, events):
#     def stringReceived(self, string):
#     def __init__(self, hosts, failover=False):
#     def buildProtocol(self, addr):
#     def _do_failover(self, connector):
#     def clientConnectionLost(self, connector, reason):
#     def clientConnectionFailed(self, connector, reason):
#     def __init__(self, host, port):
#     def sendString(self, string):
# 
# Path: duct/objects.py
# class Output(object):
#     """Output parent class
# 
#     Outputs can inherit this object which provides a construct
#     for a working output
# 
#     :param config: Dictionary config for this queue (usually read from the
#              yaml configuration)
#     :param duct: A DuctService object for interacting with the queue manager
#     """
#     def __init__(self, config, duct):
#         self.config = config
#         self.duct = duct
#         self.events = []
#         self.maxsize = 0
# 
#     def createClient(self):
#         """Deferred which sets up the output
#         """
#         pass
# 
#     def eventsReceived(self, events):
#         """Receives a list of events and queues them
# 
#         Arguments:
#         events -- list of `duct.objects.Event`
#         """
#         # Make sure queue isn't oversized
#         if self.maxsize > 0:
#             if (self.maxsize < 1) or (len(self.events) < self.maxsize):
#                 self.events.extend(events)
#         else:
#             self.events.extend(events)
# 
#     def stop(self):
#         """Called when the service shuts down
#         """
#         pass


import time
import random
from twisted.internet import reactor, defer, task
from twisted.python import log
    from OpenSSL import SSL
    from twisted.internet import ssl
from duct.protocol import riemann
from duct.objects import Output
class RiemannTCP(Output):
    """Riemann TCP output

    **Configuration arguments:**

    :param server: Riemann server hostname (default: localhost)
    :type server: str.
    :param port: Riemann server port (default: 5555)
    :type port: int.
    :param failover: Enable server failover, in which case `server` may be a
                     list
    :type failover: bool.
    :param maxrate: Maximum de-queue rate (0 is no limit)
    :type maxrate: int.
    :param maxsize: Maximum queue size (0 is no limit, default is 250000)
    :type maxsize: int.
    :param interval: De-queue interval in seconds (default: 1.0)
    :type interval: float.
    :param pressure: Maximum backpressure (-1 is no limit)
    :type pressure: int.
    :param tls: Use TLS (default false)
    :type tls: bool.
    :param cert: Host certificate path
    :type cert: str.
    :param key: Host private key path
    :type key: str.
    :param allow_nan: Send events with None metric value (default true)
    :type allow_nan: bool
    """
    def __init__(self, *a):

# Path: duct/protocol/riemann.py
# class RiemannProtobufMixin(object):
# class RiemannProtocol(Int32StringReceiver, RiemannProtobufMixin):
# class RiemannClientFactory(protocol.ReconnectingClientFactory):
# class RiemannUDP(DatagramProtocol, RiemannProtobufMixin):
#     def __init__(self):
#     def encodeEvent(self, event):
#     def encodeMessage(self, events):
#     def decodeMessage(self, data):
#     def sendEvents(self, events):
#     def stringReceived(self, string):
#     def __init__(self, hosts, failover=False):
#     def buildProtocol(self, addr):
#     def _do_failover(self, connector):
#     def clientConnectionLost(self, connector, reason):
#     def clientConnectionFailed(self, connector, reason):
#     def __init__(self, host, port):
#     def sendString(self, string):
# 
# Path: duct/objects.py
# class Output(object):
#     """Output parent class
# 
#     Outputs can inherit this object which provides a construct
#     for a working output
# 
#     :param config: Dictionary config for this queue (usually read from the
#              yaml configuration)
#     :param duct: A DuctService object for interacting with the queue manager
#     """
#     def __init__(self, config, duct):
#         self.config = config
#         self.duct = duct
#         self.events = []
#         self.maxsize = 0
# 
#     def createClient(self):
#         """Deferred which sets up the output
#         """
#         pass
# 
#     def eventsReceived(self, events):
#         """Receives a list of events and queues them
# 
#         Arguments:
#         events -- list of `duct.objects.Event`
#         """
#         # Make sure queue isn't oversized
#         if self.maxsize > 0:
#             if (self.maxsize < 1) or (len(self.events) < self.maxsize):
#                 self.events.extend(events)
#         else:
#             self.events.extend(events)
# 
#     def stop(self):
#         """Called when the service shuts down
#         """
#         pass


# Path: duct/outputs/riemann.py
import time
import random
from twisted.internet import reactor, defer, task
from twisted.python import log
    from OpenSSL import SSL
    from twisted.internet import ssl
from duct.protocol import riemann
from duct.objects import Output

class RiemannTCP(Output):
    """Riemann TCP output

    **Configuration arguments:**

    :param server: Riemann server hostname (default: localhost)
    :type server: str.
    :param port: Riemann server port (default: 5555)
    :type port: int.
    :param failover: Enable server failover, in which case `server` may be a
                     list
    :type failover: bool.
    :param maxrate: Maximum de-queue rate (0 is no limit)
    :type maxrate: int.
    :param maxsize: Maximum queue size (0 is no limit, default is 250000)
    :type maxsize: int.
    :param interval: De-queue interval in seconds (default: 1.0)
    :type interval: float.
    :param pressure: Maximum backpressure (-1 is no limit)
    :type pressure: int.
    :param tls: Use TLS (default false)
    :type tls: bool.
    :param cert: Host certificate path
    :type cert: str.
    :param key: Host private key path
    :type key: str.
    :param allow_nan: Send events with None metric value (default true)
    :type allow_nan: bool
    """
    def __init__(self, *a):

        Output.__init__(self, *a)