Beispiel #1
0
    def setUp(self):
        super(TestTimeExecution, self).setUp()

        self.topic = random_string(5)

        self.backend = KafkaBackend(KAFKA_HOST, topic=self.topic)
        settings.configure(backends=[self.backend])
Beispiel #2
0
def configure_metrics():
    # Check feature flag
    #if not settings.METRICS_ENABLED:
    #    return

    if False:
        elasticsearch = ElasticsearchBackend('localhost', index='metrics')
        settings.configure(backends=[elasticsearch])

    if True:
        metrics_backends = []
        async_es_metrics = ThreadedBackend(
            ElasticsearchBackend,
            backend_kwargs={
                'host': 'localhost',
                'port': '9200',
                #'url_prefix': settings.ELASTICSEARCH_PREFIX,
                #'use_ssl': settings.ELASTICSEARCH_SSL,
                #'verify_certs': settings.ELASTICSEARCH_VERIFY_CERTS,
                #'index': settings.ELASTICSEARCH_INDEX,
                #'http_auth': settings.ELASTICSEARCH_AUTH,
            },
        )
        metrics_backends.append(async_es_metrics)
        settings.configure(backends=metrics_backends,
                           hooks=[
                               status_code_hook,
                           ],
                           origin='inspire_next')
    def setUp(self):
        super(BaseTestTimeExecutionElasticSearch, self).setUp()

        self.backend = ElasticsearchBackend(ELASTICSEARCH_HOST,
                                            index="unittest")
        settings.configure(backends=[self.backend])
        self._clear()
Beispiel #4
0
    def setUp(self):
        super(TestTimeExecution, self).setUp()

        self.backend = ElasticsearchBackend(
            'elasticsearch',
            index='unittest',
        )
        settings.configure(backends=[self.backend])
        self._clear()
    def setUp(self):
        super(TestTimeExecution, self).setUp()

        self.backend = ElasticsearchBackend(
            'elasticsearch',
            index='unittest',
        )
        settings.configure(backends=[self.backend])
        self._clear()
 def setUp(self):
     self.qtime = 0.1
     self.backend = ThreadedBackend(
         elasticsearch.ElasticsearchBackend,
         backend_args=('elasticsearch', ),
         backend_kwargs=dict(index='threaded-metrics'),
         queue_timeout=self.qtime,
     )
     settings.configure(backends=[self.backend])
     self._clear(self.backend.backend)
 def setUp(self):
     self.qtime = 0.1
     self.backend = ThreadedBackend(
         elasticsearch.ElasticsearchBackend,
         backend_args=('elasticsearch', ),
         backend_kwargs=dict(index='threaded-metrics'),
         queue_timeout=self.qtime,
     )
     settings.configure(backends=[self.backend])
     self._clear(self.backend.backend)
    def setUp(self):
        super(TestTimeExecution, self).setUp()

        self.database = "unittest"
        self.backend = InfluxBackend(host="influx", database=self.database, use_udp=False)

        try:
            self.backend.client.create_database(self.database)
        except InfluxDBClientError:
            # Something blew up so ignore it
            pass

        settings.configure(backends=[self.backend])
Beispiel #9
0
    def setUp(self):
        super(TestTimeExecution, self).setUp()

        self.database = 'unittest'
        self.backend = InfluxBackend(host='influx',
                                     database=self.database,
                                     use_udp=False)

        try:
            self.backend.client.create_database(self.database)
        except InfluxDBClientError:
            # Something blew up so ignore it
            pass

        settings.configure(backends=[self.backend])
    def setUp(self):
        self.qsize = 10
        self.qtimeout = 0.1

        self.mocked_backend = mock.Mock(spec=elasticsearch.ElasticsearchBackend)
        self.MockedBackendClass = mock.Mock(return_value=self.mocked_backend)

        self.backend = ThreadedBackend(
            self.MockedBackendClass,
            backend_args=('arg1', 'arg2'),
            backend_kwargs=dict(key1='kwarg1', key2='kwarg2'),
            queue_maxsize=self.qsize,
            queue_timeout=self.qtimeout,
        )
        self.backend.bulk_size = self.qsize / 2
        self.backend.bulk_timeout = self.qtimeout * 2
        settings.configure(backends=[self.backend])
    def setUp(self):
        self.qsize = 10
        self.qtimeout = 0.1

        self.mocked_backend = mock.Mock(
            spec=elasticsearch.ElasticsearchBackend)
        self.MockedBackendClass = mock.Mock(return_value=self.mocked_backend)

        self.backend = ThreadedBackend(
            self.MockedBackendClass,
            backend_args=('arg1', 'arg2'),
            backend_kwargs=dict(key1='kwarg1', key2='kwarg2'),
            queue_maxsize=self.qsize,
            queue_timeout=self.qtimeout,
        )
        self.backend.bulk_size = self.qsize / 2
        self.backend.bulk_timeout = self.qtimeout * 2
        settings.configure(backends=[self.backend])