Example #1
0
def rest_request_receiver(sender, **kwargs):
    url = kwargs.get('url', None)
    request_time = kwargs.get('request_time', None)
    service_name = kwargs.get('service_name', None)
    hostname = kwargs.get('hostname', None)
    dispatch('%s_request_interval' % service_name, RawEvent.INTERVAL,
             timezone.now(), request_time, url, hostname)
Example #2
0
    def test_valid_settings(self):
        with self.settings(STATUS_APP_DISPATCHERS= ['status_app.dispatcher.memory.dispatch']):
            clear_all_events()
            dispatch('dt_test_settings', RawEvent.PASS_FAIL, timezone.now(), True, '', 'test')

            all_events = get_all_events()
            self.assertEquals(len(all_events), 1)
            self.assertEquals(all_events[0][0], 'dt_test_settings')
Example #3
0
def request_receiver(sender, status_code, path_info, request_time, **kwargs):
    if status_code >= 200 and status_code < 400:
        dispatch('application_response', RawEvent.PASS_FAIL, datetime.now(), True, '', socket.gethostname())
    else:
        dispatch('application_response', RawEvent.PASS_FAIL, datetime.now(), False, path_info, socket.gethostname())


    dispatch('application_response_time', RawEvent.INTERVAL, datetime.now(), request_time, '', socket.gethostname())
Example #4
0
def sample_receiver(sender, **kwargs):
    dispatch('test_request_finished', RawEvent.TEXT, timezone.now(), '', '', '')
Example #5
0
def rest_request_passfail_receiver(sender, **kwargs):
    url = kwargs.get('url', None)
    success = kwargs.get('success', False)
    service_name = kwargs.get('service_name', None)
    hostname = kwargs.get('hostname', None)
    dispatch('%s_request_passfail' % service_name, RawEvent.PASS_FAIL, timezone.now(), success, url, hostname)