Module: Gitlab::UsageDataCounters::NeovimPluginActivityUniqueCounter

Defined in:
lib/gitlab/usage_data_counters/neovim_plugin_activity_unique_counter.rb

Constant Summary collapse

NEOVIM_PLUGIN_API_REQUEST_ACTION =
'i_editor_extensions_user_neovim_plugin_api_request'
NEOVIM_PLUGIN_USER_AGENT_REGEX =
/gitlab.vim/

Class Method Summary collapse

Class Method Details

.track_api_request_when_trackable(user_agent:, user:) ⇒ Object



10
11
12
13
# File 'lib/gitlab/usage_data_counters/neovim_plugin_activity_unique_counter.rb', line 10

def track_api_request_when_trackable(user_agent:, user:)
  user_agent&.match?(NEOVIM_PLUGIN_USER_AGENT_REGEX) &&
    track_unique_action_by_user(NEOVIM_PLUGIN_API_REQUEST_ACTION, user)
end