@Test
public void testReportGauges() throws Exception {

	elasticsearchReporter.reportMetrics(
			metricNameMap(
					name("cpu_usage").type("user").tag("core", "1").build(), gauge(3)
			),
			metricNameMap(Counter.class),
			metricNameMap(Histogram.class),
			metricNameMap(Meter.class),
			metricNameMap(Timer.class));
	final String jsons = new String(out.toByteArray());
	assertEquals(jsons, 2, jsons.split("\n").length);
	assertEquals(
			objectMap("index", map("_type", "metrics")
					.add("_index", "stagemonitor-metrics-" + StringUtils.getLogstashStyleDate())),
			asMap(jsons.split("\n")[0]));
	assertEquals(
			objectMap("@timestamp", timestamp)
				.add("name", "cpu_usage")
				.add("app", "test")
				.add("type", "user")
				.add("core", "1")
				.add("value", 3.0),
			asMap(jsons.split("\n")[1]));
}