Added logic for calculating the usage for events.