@tornado.gen.coroutine<EOL>def get_metrics(cluster, environment, topology, timerange, query, role=None):
params = dict(<EOL>cluster=cluster,<EOL>environ=environment,<EOL>topology=topology,<EOL>starttime=timerange[<NUM_LIT:0>],<EOL>endtime=timerange[<NUM_LIT:1>],<EOL>query=query)<EOL>if role is not None:<EOL><INDENT>params['<STR_LIT>'] = role<EOL><DEDENT>request_url = tornado.httputil.url_concat(<EOL>create_url(METRICS_QUERY_URL_FMT), params<EOL>)<EOL>logging.info("<STR_LIT>", request_url)<EOL>raise tornado.gen.Return((yield fetch_url_as_json(request_url)))<EOL>
Get the metrics for a topology from tracker
:param cluster:
:param environment:
:param topology:
:param timerange:
:param query:
:param role:
:return: