public void add(double value) {
		if (Double.isNaN(value)) {
			value = 0d;
		}
		Date now = new Date();
		lastValue = value;
		avg30Min += value;

		last30Minutes.add(new Tuple<Date, Double>(new Date(), value));
		if (last30Minutes.size() > 30) {
			avg30Min -= first(last30Minutes).getSecond();
			last30Minutes.remove(0);
		}
		if (last24Hours.isEmpty()) {
			avg24h += value;
			last24Hours.add(new Tuple<Date, Double>(now, value));
		} else {
			Tuple<Date, Double> l = last(last24Hours);
			if (diff(l.getFirst(), now, TimeUnit.MINUTES) >= 30) {
				double avg = 0.0;
				for (Tuple<Date, Double> t : last30Minutes) {
					avg += t.getSecond();
				}
				avg = avg / last30Minutes.size();
				avg24h += avg;
				last24Hours.add(new Tuple<Date, Double>(now, avg));
				if (last24Hours.size() > 48) {
					avg24h -= first(last24Hours).getSecond();
					last24Hours.remove(0);
				}
			}
		}
	}