@CliCommand(value = DISPLAY_AGGR_COUNTER, help = "Display aggregate counter values by chosen interval and resolution(minute, hour)")
	public Table display(
			@CliOption(key = { "", "name" }, help = "the name of the aggregate counter to display", mandatory = true, optionContext = "existing-aggregate-counter disable-string-converter") String name,
			@CliOption(key = "from", help = "start-time for the interval. format: 'yyyy-MM-dd HH:mm:ss'", mandatory = false) String from,
			@CliOption(key = "to", help = "end-time for the interval. format: 'yyyy-MM-dd HH:mm:ss'. defaults to now", mandatory = false) String to,
			@CliOption(key = "lastHours", help = "set the interval to last 'n' hours", mandatory = false) Integer lastHours,
			@CliOption(key = "lastDays", help = "set the interval to last 'n' days", mandatory = false) Integer lastDays,
			@CliOption(key = "resolution", help = "the size of the bucket to aggregate (minute, hour, day, month)", mandatory = false, unspecifiedDefaultValue = "hour") Resolution resolution,
			@CliOption(key = "pattern", help = "the pattern used to format the count values (see DecimalFormat)", mandatory = false, unspecifiedDefaultValue = NumberFormatConverter.DEFAULT) NumberFormat pattern) {

		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		try {
			Date fromDate;
			switch (Assertions.atMostOneOf("from", from, "lastHours", lastHours, "lastDays", lastDays)) {
				case 0:
					fromDate = dateFormat.parse(from);
					break;
				case 1:
					fromDate = new Date(System.currentTimeMillis() - ((long) lastHours)
							* DateTimeConstants.MILLIS_PER_HOUR);
					break;
				case 2:
					fromDate = new Date(System.currentTimeMillis() - ((long) lastDays)
							* DateTimeConstants.MILLIS_PER_DAY);
					break;
				default:
					fromDate = null;
					break;
			}

			Date toDate = (to == null) ? null : dateFormat.parse(to);
			AggregateCountsResource aggResource = aggrCounterOperations().retrieve(name, fromDate, toDate, resolution);
			return displayAggrCounter(aggResource, pattern);
		}
		catch (ParseException pe) {
			throw new IllegalArgumentException(
					"Parse exception ocurred while parsing the 'from/to' options. The accepted date format is "
							+ dateFormat.toPattern());
		}
	}
Commands for interacting with aggregate counter analytics.

@author Ilayaperumal Gopinathan
spring-xd-shell/src/main/java/org/springframework/xd/shell/command/AggregateCounterCommands.java