add statistics collector from previous events

average of previous data is now collected at start, selectFrom method added to mysql object to make queries easier