add function of get avg event count