class MqMetricReporter extends ScheduledReporter {

	@Override
	public void report(SortedMap<String, Gauge> gauges, SortedMap<String, Counter> counters,
			SortedMap<String, Histogram> histograms, SortedMap<String, Meter> meters, SortedMap<String, Timer> timers) {
		if (!Util.isEmpty(mqContext.getMetricUrl())) {
			final long timestamp = System.currentTimeMillis();
			final Set<Metric> metrics = new HashSet<>();

			for (Map.Entry<String, Gauge> entry : gauges.entrySet()) {
				metrics.addAll(buildGauge(entry.getKey(), entry.getValue(), timestamp, tags));
			}
			for (Map.Entry<String, Counter> entry : counters.entrySet()) {
				metrics.addAll(buildCounter(entry.getKey(), entry.getValue(), timestamp, tags));
			}

			for (Map.Entry<String, Histogram> entry : histograms.entrySet()) {
				metrics.addAll(buildHistograms(entry.getKey(), entry.getValue(), timestamp, tags));
			}

			for (Map.Entry<String, Meter> entry : meters.entrySet()) {
				metrics.addAll(buildMeters(entry.getKey(), entry.getValue(), timestamp, tags));
			}

			for (Map.Entry<String, Timer> entry : timers.entrySet()) {
				metrics.addAll(buildTimers(entry.getKey(), entry.getValue(), timestamp, tags));
			}
			try {
				if (!Util.isEmpty(mqContext.getMetricUrl()) && metrics.size() > 0) {					
					httpClient.post(mqContext.getMetricUrl(), metrics);
				}
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}

	public  MqMetricReporter(MetricRegistry registry, String name, MetricFilter filter, TimeUnit rateUnit,
			TimeUnit durationUnit, Map<String, String> tags, MqContext mqContext);

}