class AmbariMetricsServiceWithStormQuerier extends AbstractTimeSeriesQuerier {

    @Override
    public Map<Long, Double> getMetrics(String topologyName, String componentId, String metricName,
                                        AggregateFunction aggrFunction, long from, long to) {

        Optional<String> weightMetric = findWeightMetric(metricName);

        if (weightMetric.isPresent()) {
            Map<Long, List<Pair<String, Double>>> keyMetrics = getMetricsStreamToValueMap(topologyName, componentId,
                    metricName, from, to);
            Map<Long, List<Pair<String, Double>>> weightMetrics = getMetricsStreamToValueMap(topologyName, componentId,
                    weightMetric.get(), from, to);
            return aggregateWithApplyingWeightedAverage(keyMetrics, weightMetrics);
        } else {
            Map<Long, List<Pair<String, Double>>> ret = getMetricsStreamToValueMap(topologyName, componentId, metricName, from, to);
            return aggregateStreamsForMetricsValues(ret, aggrFunction);
        }
    }

    public  AmbariMetricsServiceWithStormQuerier();

}