synchronized long increment(long amount, DateTime dateTime) {
		int year = dateTime.getYear();
		int month = dateTime.getMonthOfYear();
		int day = dateTime.getDayOfYear();
		int hour = dateTime.getHourOfDay();
		int minute = dateTime.getMinuteOfDay();

		long[] monthCounts = monthCountsByYear.get(year);
		long[] dayCounts = dayCountsByYear.get(year);

		if (monthCounts == null) {
			monthCounts = new long[12];
			monthCountsByYear.put(year, monthCounts);
			dayCounts = new long[daysInYear(year)];
			dayCountsByYear.put(year, dayCounts);
		}

		int countsByDayKey = year * 1000 + day;
		long[] hourCounts = hourCountsByDay.get(countsByDayKey);

		if (hourCounts == null) {
			hourCounts = new long[24];
			hourCountsByDay.put(countsByDayKey, hourCounts);
		}

		long[] minuteCounts = minuteCountsByDay.get(countsByDayKey);

		if (minuteCounts == null) {
			minuteCounts = new long[60 * 24];
			minuteCountsByDay.put(countsByDayKey, minuteCounts);
		}

		minuteCounts[minute] += amount;
		monthCounts[month-1] += amount;
		dayCounts[day-1] += amount;
		hourCounts[hour] += amount;

		return increment(amount);
	}
A counter that tracks integral values but also remembers how its value was distributed over time.

<p>
This core class only holds data structures. Depending on backing stores, logic for computing totals may be
implemented in a specialization of this class or at the repository level.
</p>

@author Luke Taylor
@author Eric Bottard
spring-xd-analytics/src/main/java/org/springframework/xd/analytics/metrics/memory/InMemoryAggregateCounter.java