How to use the transaction.Transaction.__init__ function in transaction

To help you get started, we’ve selected a few transaction examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DataDog / dd-agent / tests / test_transaction.py View on Github external
def __init__(self, size, manager):
        Transaction.__init__(self)
        self._trManager = manager
        self._size = size
        self._flush_count = 0

        self.is_flushable = False
github serverdensity / sd-agent / tests / core / test_transaction.py View on Github external
def __init__(self, manager, delay=0.5):
        Transaction.__init__(self)
        self._trManager = manager
        self._size = 1
        self._flush_count = 0
        self._endpoint = 'https://example.com'
        self._api_key = 'a' * 32
        self.delay = delay

        self.is_flushable = False
github serverdensity / sd-agent / tests / core / test_transaction.py View on Github external
def __init__(self, size, manager):
        Transaction.__init__(self)
        self._trManager = manager
        self._size = size
        self._flush_count = 0
        self._endpoint = 'https://example.com'
        self._api_key = 'a' * 32

        self.is_flushable = False
github serverdensity / sd-agent / sdagent.py View on Github external
def __init__(self, data, headers, msg_type=""):
        self._data = data
        self._headers = headers
        self._headers['SD-Forwarder-Version'] = get_version()
        self._msg_type = msg_type

        # Call after data has been set (size is computed in Transaction's init)
        Transaction.__init__(self)

        # Emitters operate outside the regular transaction framework
        if self._emitter_manager is not None:
            self._emitter_manager.send(data, headers)

        # Insert the transaction(s) in the Manager
        for endpoint in self._endpoints:
            for agent_key in self._endpoints[endpoint]:
                transaction = copy.copy(self)
                transaction._endpoint = endpoint
                transaction._agent_key = agent_key
                self._trManager.append(transaction)
                log.debug("Created transaction %d" % transaction.get_id())
        self._trManager.flush()
github DataDog / dd-agent / ddagent.py View on Github external
def __init__(self, data, headers):
        self._data = data
        self._headers = headers

        # Call after data has been set (size is computed in Transaction's init)
        Transaction.__init__(self)

        # Emitters operate outside the regular transaction framework
        if self._emitter_manager is not None:
            self._emitter_manager.send(data, headers)

        # Insert the transaction in the Manager
        self._trManager.append(self)
        log.debug("Created transaction %d" % self.get_id())
        self._trManager.flush()