@tornado.gen.coroutine<EOL><INDENT>def fetch_backpressure(self, cluster, metric, topology, component, instance,timerange, is_max, environ=None):<DEDENT>
instances = yield get_instances(cluster, environ, topology)<EOL>if component != "<STR_LIT:*>":<EOL><INDENT>filtered_inst = [instance for instance in instances if instance.split("<STR_LIT:_>")[<NUM_LIT:2>] == component]<EOL><DEDENT>else:<EOL><INDENT>filtered_inst = instances<EOL><DEDENT>futures_dict = {}<EOL>for inst in filtered_inst:<EOL><INDENT>query = queries.get(metric).format(inst)<EOL>futures_dict[inst] = get_metrics(cluster, environ, topology, timerange, query)<EOL><DEDENT>res = yield futures_dict<EOL>if not is_max:<EOL><INDENT>timelines = []<EOL>for key in res:<EOL><INDENT>result = res[key]<EOL>if len(result["<STR_LIT>"]) > <NUM_LIT:0>:<EOL><INDENT>result["<STR_LIT>"][<NUM_LIT:0>]["<STR_LIT>"] = key<EOL><DEDENT>timelines.extend(result["<STR_LIT>"])<EOL><DEDENT>result = self.get_metric_response(timerange, timelines, is_max)<EOL><DEDENT>else:<EOL><INDENT>data = self.compute_max(res.values())<EOL>result = self.get_metric_response(timerange, data, is_max)<EOL><DEDENT>raise tornado.gen.Return(result)<EOL>
:param cluster:
:param metric:
:param topology:
:param component:
:param instance:
:param timerange:
:param isMax:
:param environ:
:return: