diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-17 12:10:08 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-17 12:10:08 +0300 |
commit | 325318e2ddfcaedf0527053dd3c9bd62db547089 (patch) | |
tree | 2525b4135802427a95233219d9d339ceadb51280 /lib/gitlab | |
parent | c64b892786865a3b87701450c6ca62fcab0fa044 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab')
-rw-r--r-- | lib/gitlab/usage_data.rb | 6 | ||||
-rw-r--r-- | lib/gitlab/usage_data_counters/track_unique_actions.rb | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/gitlab/usage_data.rb b/lib/gitlab/usage_data.rb index ccfb7b3870f..db2aff9b25a 100644 --- a/lib/gitlab/usage_data.rb +++ b/lib/gitlab/usage_data.rb @@ -607,7 +607,7 @@ module Gitlab counter = Gitlab::UsageDataCounters::TrackUniqueActions project_count = redis_usage_data do - counter.count_unique_events( + counter.count_unique( event_action: Gitlab::UsageDataCounters::TrackUniqueActions::PUSH_ACTION, date_from: time_period[:created_at].first, date_to: time_period[:created_at].last @@ -615,7 +615,7 @@ module Gitlab end design_count = redis_usage_data do - counter.count_unique_events( + counter.count_unique( event_action: Gitlab::UsageDataCounters::TrackUniqueActions::DESIGN_ACTION, date_from: time_period[:created_at].first, date_to: time_period[:created_at].last @@ -623,7 +623,7 @@ module Gitlab end wiki_count = redis_usage_data do - counter.count_unique_events( + counter.count_unique( event_action: Gitlab::UsageDataCounters::TrackUniqueActions::WIKI_ACTION, date_from: time_period[:created_at].first, date_to: time_period[:created_at].last diff --git a/lib/gitlab/usage_data_counters/track_unique_actions.rb b/lib/gitlab/usage_data_counters/track_unique_actions.rb index 686cce8e0ac..b7948b07251 100644 --- a/lib/gitlab/usage_data_counters/track_unique_actions.rb +++ b/lib/gitlab/usage_data_counters/track_unique_actions.rb @@ -27,7 +27,7 @@ module Gitlab }).freeze class << self - def track_action(event_action:, event_target:, author_id:, time: Time.zone.now) + def track_event(event_action:, event_target:, author_id:, time: Time.zone.now) return unless Gitlab::CurrentSettings.usage_ping_enabled return unless Feature.enabled?(FEATURE_FLAG) return unless valid_target?(event_target) @@ -40,7 +40,7 @@ module Gitlab Gitlab::Redis::HLL.add(key: target_key, value: author_id, expiry: KEY_EXPIRY_LENGTH) end - def count_unique_events(event_action:, date_from:, date_to:) + def count_unique(event_action:, date_from:, date_to:) keys = (date_from.to_date..date_to.to_date).map { |date| key(event_action, date) } Gitlab::Redis::HLL.count(keys: keys) |