@ResponseBody
	@RequestMapping(value = "", method = RequestMethod.GET)
	public PagedResources<? extends MetricResource> list(Pageable pageable,
			PagedResourcesAssembler<Counter> pagedAssembler,
			@RequestParam(value = "detailed", defaultValue = "false") boolean detailed,//
			@RequestParam(value = "from", required = false) @DateTimeFormat(iso = ISO.DATE_TIME) DateTime from, //
			@RequestParam(value = "to", required = false) @DateTimeFormat(iso = ISO.DATE_TIME) DateTime to, //
			@RequestParam(value = "resolution", defaultValue = "hour") AggregateCountResolution resolution) {
		PagedResources<? extends MetricResource> resources = list(pageable, pagedAssembler, shallowResourceAssembler);
		if (detailed) {
			to = providedOrDefaultToValue(to);
			from = providedOrDefaultFromValue(from, to, resolution);
			Interval interval = new Interval(from, to);

			List<AggregateCountsResource> aggregateCounts = new LinkedList<>();
			for (MetricResource metricResource : resources) {
				AggregateCount aggregateCount = repository.getCounts(metricResource.getName(), interval, resolution);
				aggregateCounts.add(aggregateCountResourceAssembler.toResource(aggregateCount));
			}
			return new PagedResources<>(aggregateCounts, resources.getMetadata());
		}
		return resources;
	}
List {@link AggregateCount}s that match the given criteria.
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/rest/metrics/AggregateCountersController.java