Follow-up from "Add increment_counter to Usage Ping API"

The following discussion from !47309 (merged) should be addressed:

Each time UsageDataCounters.count gets called, all counter classes are looped to find one matching class. Some sort of hash mapping or caching can be implemented to reduce this repeated lookup.

Edited by 🤖 GitLab Bot 🤖