Beispiel #1
0
    def proxy_to_kairos(self, host, port, time_range):
        """ Send this KQuery to Kairos with a custom time range and get the response.
            :param host: str, kairosdb host.
            :param port: int, kairosdb port.
            :param time_range: dict, usually generated via utils.populate_time_range
            :return: dict, the response from kairos
            :raise: utils.BackendQueryFailure, if the query fails.
        """
        proxy_query = copy.deepcopy(time_range)
        proxy_query['metrics'] = [self.query]
        proxy_query['cache_time'] = 0

        kairos_result = query_kairos(host, port, proxy_query)

        if len(kairos_result['queries']) != 1:
            logging.error("Proxy expected 1 KQuery result, found %d" % len(kairos_result['queries']))
        return kairos_result
Beispiel #2
0
    def proxy_to_kairos(self, host, port, time_range):
        """ Send this KQuery to Kairos with a custom time range and get the response.
            :param host: str, kairosdb host.
            :param port: int, kairosdb port.
            :param time_range: dict, usually generated via utils.populate_time_range
            :return: dict, the response from kairos
            :raise: utils.BackendQueryFailure, if the query fails.
        """
        proxy_query = copy.deepcopy(time_range)
        proxy_query['metrics'] = [self.query]
        proxy_query['cache_time'] = 0

        kairos_result = query_kairos(host, port, proxy_query)

        if len(kairos_result['queries']) != 1:
            logging.error("Proxy expected 1 KQuery result, found %d" %
                          len(kairos_result['queries']))
        return kairos_result
Beispiel #3
0
 def _thread_wrap(ndx, query):
     results[ndx] = query_kairos(host, port, query, propagate=False)
Beispiel #4
0
 def _thread_wrap(ndx, query):
     results[ndx] = query_kairos(host, port, query, propagate=False)