def __init__(self, connectionFactory):
    """
    :param connectionFactory: connection factory for creating database
      connections.
    """
    super(_CustomDatasourceAdapter, self).__init__()

    self._log = htmengine_logging.getExtendedLogger(
      "htmengine.custom_datasource_adapter")

    self.connectionFactory = connectionFactory
Exemple #2
0
    def __init__(self, connectionFactory):
        """
    :param connectionFactory: connection factory for creating database
      connections.
    """
        super(_CustomDatasourceAdapter, self).__init__()

        self._log = htmengine_logging.getExtendedLogger(
            "htmengine.custom_datasource_adapter")

        self.connectionFactory = connectionFactory
    def __init__(self):
        super(MetricStreamer, self).__init__()

        # Make sure we have the latest version of configuration
        config.loadConfig()

        self._log = htmengine_logging.getExtendedLogger(self.__class__.__name__)

        self._profiling = config.getboolean("debugging", "profiling") or self._log.isEnabledFor(logging.DEBUG)

        self._metricDataOutputChunkSize = config.getint("metric_streamer", "chunk_size")

        # Cache of latest metric_data timestamps for each metric; used for filtering
        # out duplicate/re-delivered input metric data so it won't be saved again
        # in the metric_data table. Each key is a metric id and the corresponding
        # value is a datetime.datetime timestamp of the last metric_data stored by
        # us in metric_data table.
        self._tailInputMetricDataTimestamps = dict()
        # Last garbage-collection time; seconds since unix epoch (time.time())
        self._lastTailInputMetricDataTimestampsGCTime = 0
    def __init__(self):
        super(MetricStreamer, self).__init__()

        # Make sure we have the latest version of configuration
        config.loadConfig()

        self._log = htmengine_logging.getExtendedLogger(
            self.__class__.__name__)

        self._profiling = (config.getboolean("debugging", "profiling")
                           or self._log.isEnabledFor(logging.DEBUG))

        self._metricDataOutputChunkSize = config.getint(
            "metric_streamer", "chunk_size")

        # Cache of latest metric_data timestamps for each metric; used for filtering
        # out duplicate/re-delivered input metric data so it won't be saved again
        # in the metric_data table. Each key is a metric id and the corresponding
        # value is a datetime.datetime timestamp of the last metric_data stored by
        # us in metric_data table.
        self._tailInputMetricDataTimestamps = dict()
        # Last garbage-collection time; seconds since unix epoch (time.time())
        self._lastTailInputMetricDataTimestampsGCTime = 0
def _getLogger():
  return getExtendedLogger(_MODULE_NAME)
def _getLogger():
    return getExtendedLogger(_MODULE_NAME)
Exemple #7
0
def _getLogger():
  return htmengine_logging.getExtendedLogger(_MODULE_NAME)
def setUpModule():
  LoggingSupport.initTestApp()

  global g_log  # pylint: disable=W0603
  g_log = getExtendedLogger("custom_datasource_adapter_test")
Exemple #9
0
def _getLogger():
  return htmengine_logging.getExtendedLogger(_MODULE_NAME)
from nta.utils.logging_support_raw import LoggingSupport
from nta.utils import threading_utils

from htmengine import raiseExceptionOnMissingRequiredApplicationConfigPath
from htmengine.htmengine_logging import getExtendedLogger
from htmengine.model_swapper.model_swapper_interface import (
  MessageBusConnector)
from nta.utils.message_bus_connector import MessageQueueNotFound



# Max number of data samples per batch
_MAX_BATCH_SIZE = 200


LOGGER = getExtendedLogger(__name__)

gQueueName = None

gProfiling = False




class Protocol(object):
  """
  Currently supports only the Carbon plaintext protocol
  Future options are pickle and amqp
  """

  PLAIN = "plain"
from nta.utils.logging_support_raw import LoggingSupport
from nta.utils import threading_utils

from htmengine import raiseExceptionOnMissingRequiredApplicationConfigPath
from htmengine.htmengine_logging import getExtendedLogger
from htmengine.model_swapper.model_swapper_interface import (
  MessageBusConnector)
from nta.utils.message_bus_connector import MessageQueueNotFound



# Max number of data samples per batch
_MAX_BATCH_SIZE = 200


LOGGER = getExtendedLogger(__name__)

gQueueName = None

gProfiling = False




class Protocol(object):
  """
  Currently supports only the Carbon plaintext protocol
  Future options are pickle and amqp
  """

  PLAIN = "plain"
Exemple #12
0
def setUpModule():
    LoggingSupport.initTestApp()

    global g_log  # pylint: disable=W0603
    g_log = getExtendedLogger("custom_datasource_adapter_test")