public void analyseRecord(int id, byte[] record) throws IOException
	{
		ByteArrayInputStream bis = new ByteArrayInputStream(record);
		DataInputStream dis = new DataInputStream(bis);
		long trip_stamp = dis.readLong();
		dis.readUTF();
		dis.readByte(); // should be 0xFE
		long ts = dis.readLong();
		
		if (collectedRecordIDs.size() > MAX_RECORDS_IN_PUSH){
			return;
		}

		if (min_ts == -1) {
			min_ts = ts;
		}
		if (max_ts == -1) {
			max_ts = ts;
		}
		if (collected_trip_stamp == -1) {
			collected_trip_stamp = trip_stamp;
		}
		if (collected_trip_stamp != trip_stamp){
			// event is outside of a threshold?
			if ((min_ts - ts > EVENTS_GROUP_THRESHOLD) ||
			    (ts - max_ts > EVENTS_GROUP_THRESHOLD))
			{
				// drop this event
				return;
			}
		}
		if (min_ts > ts){
		  min_ts = ts;
		}
		if (max_ts < ts){
		  max_ts = ts;
		}

		// event is ok, push it
		collectedRecordIDs.addElement(new Integer(id));
		collectedRecordBytes.addElement(record);
	}