@tornado.gen.coroutine<EOL>def get_comp_metrics(cluster, environ, topology, component,<EOL>instances, metricnames, time_range, role=None):
params = dict(<EOL>cluster=cluster,<EOL>environ=environ,<EOL>topology=topology,<EOL>component=component)<EOL>if role is not None:<EOL><INDENT>params['<STR_LIT>'] = role<EOL><DEDENT>request_url = tornado.httputil.url_concat(<EOL>create_url(METRICS_URL_FMT), params)<EOL>for metric_name in metricnames:<EOL><INDENT>request_url = tornado.httputil.url_concat(request_url, dict(metricname=metric_name))<EOL><DEDENT>for instance in instances:<EOL><INDENT>request_url = tornado.httputil.url_concat(request_url, dict(instance=instance))<EOL><DEDENT>request_url = tornado.httputil.url_concat(request_url, dict(interval=time_range[<NUM_LIT:1>]))<EOL>raise tornado.gen.Return((yield fetch_url_as_json(request_url)))<EOL>
Get the metrics for all the instances of a topology from Heron Nest
:param cluster:
:param environ:
:param topology:
:param component:
:param instances:
:param metricnames:   dict of display name to cuckoo name
:param time_range:    2-tuple consisting of start and end of range
:param role:
:return: