Follow-up from "Track unique wiki page views in Usage Ping"
The following discussion from !44622 (merged) should be addressed:
-
@toupeira started a discussion: (+1 comment) question: I had to add
.to_s
because the constants inTrackUniqueEvents
are defined as symbols, but the values inknown_events.yml
are strings and we do a strict comparison at https://gitlab.com/gitlab-org/gitlab/blob/b30b770b3e5c6219ac2ccfbeae2fa5ab5b3b1f3a/lib/gitlab/usage_data_counters/hll_redis_counter.rb#L144.But I saw we also have a few
.to_s
calls at https://gitlab.com/gitlab-org/gitlab/blob/b30b770b3e5c6219ac2ccfbeae2fa5ab5b3b1f3a/lib/gitlab/usage_data_counters/track_unique_events.rb#L41-47, so maybe we should remove those and change the constants to be strings?🤔
@a_akgun Or or modify
def event_for(event_name)
and stringify or symbolize before comparison.