diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
commit | 0653e08efd039a5905f3fa4f6e9cef9f5d2f799c (patch) | |
tree | 4dcc884cf6d81db44adae4aa99f8ec1233a41f55 /lib/gitlab/usage_data_counters | |
parent | 744144d28e3e7fddc117924fef88de5d9674fe4c (diff) |
Add latest changes from gitlab-org/gitlab@14-3-stable-eev14.3.0-rc42
Diffstat (limited to 'lib/gitlab/usage_data_counters')
8 files changed, 607 insertions, 67 deletions
diff --git a/lib/gitlab/usage_data_counters/ci_template_unique_counter.rb b/lib/gitlab/usage_data_counters/ci_template_unique_counter.rb index c9106d7c6b8..e5a50c92329 100644 --- a/lib/gitlab/usage_data_counters/ci_template_unique_counter.rb +++ b/lib/gitlab/usage_data_counters/ci_template_unique_counter.rb @@ -3,6 +3,7 @@ module Gitlab::UsageDataCounters class CiTemplateUniqueCounter REDIS_SLOT = 'ci_templates' + KNOWN_EVENTS_FILE_PATH = File.expand_path('known_events/ci_templates.yml', __dir__) # NOTE: Events originating from implicit Auto DevOps pipelines get prefixed with `implicit_` TEMPLATE_TO_EVENT = { @@ -20,19 +21,24 @@ module Gitlab::UsageDataCounters class << self def track_unique_project_event(project_id:, template:, config_source:) - if event = unique_project_event(template, config_source) - Gitlab::UsageDataCounters::HLLRedisCounter.track_event(event, values: project_id) - end + Gitlab::UsageDataCounters::HLLRedisCounter.track_event(ci_template_event_name(template, config_source), values: project_id) end - private + def ci_templates(relative_base = 'lib/gitlab/ci/templates') + Dir.glob('**/*.gitlab-ci.yml', base: Rails.root.join(relative_base)) + end + + def ci_template_event_name(template_name, config_source) + prefix = 'implicit_' if config_source.to_s == 'auto_devops_source' + template_event_name = TEMPLATE_TO_EVENT[template_name] || template_to_event_name(template_name) - def unique_project_event(template, config_source) - if name = TEMPLATE_TO_EVENT[template] - prefix = 'implicit_' if config_source.to_s == 'auto_devops_source' + "p_#{REDIS_SLOT}_#{prefix}#{template_event_name}" + end + + private - "p_#{REDIS_SLOT}_#{prefix}#{name}" - end + def template_to_event_name(template) + ActiveSupport::Inflector.parameterize(template.chomp('.gitlab-ci.yml'), separator: '_').underscore end end end diff --git a/lib/gitlab/usage_data_counters/hll_redis_counter.rb b/lib/gitlab/usage_data_counters/hll_redis_counter.rb index 96562a44391..8fc8bb5d344 100644 --- a/lib/gitlab/usage_data_counters/hll_redis_counter.rb +++ b/lib/gitlab/usage_data_counters/hll_redis_counter.rb @@ -18,6 +18,24 @@ module Gitlab KNOWN_EVENTS_PATH = File.expand_path('known_events/*.yml', __dir__) ALLOWED_AGGREGATIONS = %i(daily weekly).freeze + CATEGORIES_FOR_TOTALS = %w[ + analytics + code_review + compliance + deploy_token_packages + ecosystem + epic_boards_usage + epics_usage + ide_edit + incident_management + issues_edit + pipeline_authoring + quickactions + search + testing + user_packages + ].freeze + # Track event on entity_id # Increment a Redis HLL counter for unique event_name and entity_id # @@ -90,7 +108,7 @@ module Gitlab hash["#{event}_monthly"] = unique_events(**monthly_time_range.merge(event_names: [event])) end - if eligible_for_totals?(events_names) + if eligible_for_totals?(events_names) && CATEGORIES_FOR_TOTALS.include?(category) event_results["#{category}_total_unique_counts_weekly"] = unique_events(**weekly_time_range.merge(event_names: events_names)) event_results["#{category}_total_unique_counts_monthly"] = unique_events(**monthly_time_range.merge(event_names: events_names)) end diff --git a/lib/gitlab/usage_data_counters/known_events/analytics.yml b/lib/gitlab/usage_data_counters/known_events/analytics.yml index e4f20b61901..261bdeb9bfa 100644 --- a/lib/gitlab/usage_data_counters/known_events/analytics.yml +++ b/lib/gitlab/usage_data_counters/known_events/analytics.yml @@ -2,84 +2,67 @@ category: analytics redis_slot: analytics aggregation: weekly - feature_flag: track_unique_visits - name: i_analytics_dev_ops_adoption category: analytics redis_slot: analytics aggregation: weekly - feature_flag: track_unique_visits - name: i_analytics_dev_ops_score category: analytics redis_slot: analytics aggregation: weekly - feature_flag: track_unique_visits - name: p_analytics_merge_request category: analytics redis_slot: analytics aggregation: weekly - feature_flag: track_unique_visits - name: i_analytics_instance_statistics category: analytics redis_slot: analytics aggregation: weekly - feature_flag: track_unique_visits - name: g_analytics_contribution category: analytics redis_slot: analytics aggregation: weekly - feature_flag: track_unique_visits - name: g_analytics_insights category: analytics redis_slot: analytics aggregation: weekly - feature_flag: track_unique_visits - name: g_analytics_issues category: analytics redis_slot: analytics aggregation: weekly - feature_flag: track_unique_visits - name: g_analytics_productivity category: analytics redis_slot: analytics aggregation: weekly - feature_flag: track_unique_visits - name: g_analytics_valuestream category: analytics redis_slot: analytics aggregation: weekly - feature_flag: track_unique_visits - name: p_analytics_pipelines category: analytics redis_slot: analytics aggregation: weekly - feature_flag: track_unique_visits - name: p_analytics_code_reviews category: analytics redis_slot: analytics aggregation: weekly - feature_flag: track_unique_visits - name: p_analytics_valuestream category: analytics redis_slot: analytics aggregation: weekly - feature_flag: track_unique_visits - name: p_analytics_insights category: analytics redis_slot: analytics aggregation: weekly - feature_flag: track_unique_visits - name: p_analytics_issues category: analytics redis_slot: analytics aggregation: weekly - feature_flag: track_unique_visits - name: p_analytics_repo category: analytics redis_slot: analytics aggregation: weekly - feature_flag: track_unique_visits - name: i_analytics_cohorts category: analytics redis_slot: analytics aggregation: weekly - feature_flag: track_unique_visits diff --git a/lib/gitlab/usage_data_counters/known_events/ci_templates.yml b/lib/gitlab/usage_data_counters/known_events/ci_templates.yml index 3c692f2b1af..cf790767f17 100644 --- a/lib/gitlab/usage_data_counters/known_events/ci_templates.yml +++ b/lib/gitlab/usage_data_counters/known_events/ci_templates.yml @@ -4,73 +4,590 @@ redis_slot: ci_templates aggregation: weekly -- name: p_ci_templates_implicit_auto_devops_build +# Explicit include:template pipeline events +- name: p_ci_templates_5_min_production_app category: ci_templates redis_slot: ci_templates aggregation: weekly -- name: p_ci_templates_implicit_auto_devops_deploy +- name: p_ci_templates_aws_cf_deploy_ec2 category: ci_templates redis_slot: ci_templates aggregation: weekly -- name: p_ci_templates_implicit_security_sast +- name: p_ci_templates_auto_devops_build category: ci_templates redis_slot: ci_templates aggregation: weekly -- name: p_ci_templates_implicit_security_secret_detection +- name: p_ci_templates_auto_devops_deploy category: ci_templates redis_slot: ci_templates aggregation: weekly -# Explicit include:template pipeline events -- name: p_ci_templates_5_min_production_app +- name: p_ci_templates_auto_devops_deploy_latest category: ci_templates redis_slot: ci_templates aggregation: weekly +# This part of the file is generated automatically by +# bin/rake gitlab:usage_data:generate_ci_template_events +# +# Do not edit it manually! +# +# The section above this should be removed once we roll out tracking all ci +# templates +# https://gitlab.com/gitlab-org/gitlab/-/issues/339684 + +- name: p_ci_templates_terraform_base_latest + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_terraform_base + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_dotnet + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_nodejs + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_openshift + category: ci_templates + redis_slot: ci_templates + aggregation: weekly - name: p_ci_templates_auto_devops category: ci_templates redis_slot: ci_templates aggregation: weekly - -- name: p_ci_templates_aws_cf_deploy_ec2 +- name: p_ci_templates_bash category: ci_templates redis_slot: ci_templates aggregation: weekly - -- name: p_ci_templates_aws_deploy_ecs +- name: p_ci_templates_rust category: ci_templates redis_slot: ci_templates aggregation: weekly - -- name: p_ci_templates_auto_devops_build +- name: p_ci_templates_elixir category: ci_templates redis_slot: ci_templates aggregation: weekly - -- name: p_ci_templates_auto_devops_deploy +- name: p_ci_templates_clojure category: ci_templates redis_slot: ci_templates aggregation: weekly - -- name: p_ci_templates_auto_devops_deploy_latest +- name: p_ci_templates_crystal + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_getting_started + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_code_quality + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_verify_load_performance_testing + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_verify_accessibility + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_verify_failfast + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_verify_browser_performance + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_verify_browser_performance_latest + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_grails category: ci_templates redis_slot: ci_templates aggregation: weekly - - name: p_ci_templates_security_sast category: ci_templates redis_slot: ci_templates aggregation: weekly - +- name: p_ci_templates_security_dast_runner_validation + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_security_dast_on_demand_scan + category: ci_templates + redis_slot: ci_templates + aggregation: weekly - name: p_ci_templates_security_secret_detection category: ci_templates redis_slot: ci_templates aggregation: weekly - -- name: p_ci_templates_terraform_base_latest +- name: p_ci_templates_security_license_scanning + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_security_coverage_fuzzing + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_security_api_fuzzing_latest + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_security_secure_binaries + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_security_dast_api + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_security_container_scanning + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_security_dast_latest + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_security_dependency_scanning + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_security_api_fuzzing + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_security_dast + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_security_cluster_image_scanning + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_ios_fastlane + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_composer + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_c + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_python + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_android_fastlane + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_android_latest + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_django + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_maven + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_flutter + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_workflows_branch_pipelines + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_workflows_mergerequest_pipelines + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_laravel + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_managed_cluster_applications + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_php + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_packer + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_terraform + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_mono + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_serverless + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_go + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_scala + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_latex + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_android + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_indeni_cloudrail + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_deploy_ecs + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_aws_cf_provision_and_deploy_ec2 + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_aws_deploy_ecs + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_gradle + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_chef + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_jobs_dast_default_branch_deploy + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_jobs_load_performance_testing + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_jobs_helm_2to3 + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_jobs_sast + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_jobs_secret_detection + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_jobs_code_intelligence + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_jobs_code_quality + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_jobs_deploy_ecs + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_jobs_deploy_ec2 + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_jobs_deploy + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_jobs_build + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_jobs_browser_performance_testing + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_jobs_test + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_jobs_deploy_latest + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_jobs_browser_performance_testing_latest + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_jobs_cf_provision + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_jobs_build_latest + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_terraform_latest + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_swift + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_pages_jekyll + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_pages_harp + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_pages_octopress + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_pages_brunch + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_pages_doxygen + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_pages_hyde + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_pages_lektor + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_pages_jbake + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_pages_hexo + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_pages_middleman + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_pages_hugo + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_pages_pelican + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_pages_nanoc + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_pages_swaggerui + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_pages_jigsaw + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_pages_metalsmith + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_pages_gatsby + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_pages_html + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_dart + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_docker + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_julia + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_npm + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_dotnet_core + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_5_minute_production_app + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_ruby + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_implicit_jobs_dast_default_branch_deploy + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_implicit_jobs_load_performance_testing + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_implicit_jobs_helm_2to3 + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_implicit_jobs_sast + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_implicit_jobs_secret_detection + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_implicit_jobs_code_intelligence + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_implicit_jobs_code_quality + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_implicit_jobs_deploy_ecs + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_implicit_jobs_deploy_ec2 + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_implicit_auto_devops_deploy + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_implicit_auto_devops_build + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_implicit_jobs_browser_performance_testing + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_implicit_jobs_test + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_implicit_auto_devops_deploy_latest + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_implicit_jobs_browser_performance_testing_latest + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_implicit_jobs_cf_provision + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_implicit_jobs_build_latest + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_implicit_security_sast + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_implicit_security_dast_runner_validation + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_implicit_security_dast_on_demand_scan + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_implicit_security_secret_detection + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_implicit_security_license_scanning + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_implicit_security_coverage_fuzzing + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_implicit_security_api_fuzzing_latest + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_implicit_security_secure_binaries + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_implicit_security_dast_api + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_implicit_security_container_scanning + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_implicit_security_dast_latest + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_implicit_security_dependency_scanning + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_implicit_security_api_fuzzing + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_implicit_security_dast + category: ci_templates + redis_slot: ci_templates + aggregation: weekly +- name: p_ci_templates_implicit_security_cluster_image_scanning category: ci_templates redis_slot: ci_templates aggregation: weekly diff --git a/lib/gitlab/usage_data_counters/known_events/code_review_events.yml b/lib/gitlab/usage_data_counters/known_events/code_review_events.yml index 7ad51bfe832..d4a818f8fe0 100644 --- a/lib/gitlab/usage_data_counters/known_events/code_review_events.yml +++ b/lib/gitlab/usage_data_counters/known_events/code_review_events.yml @@ -237,3 +237,15 @@ category: code_review aggregation: weekly feature_flag: diff_searching_usage_data +- name: i_code_review_total_suggestions_applied + redis_slot: code_review + category: code_review + aggregation: weekly +- name: i_code_review_total_suggestions_added + redis_slot: code_review + category: code_review + aggregation: weekly +- name: i_code_review_user_resolve_thread_in_issue + redis_slot: code_review + category: code_review + aggregation: weekly diff --git a/lib/gitlab/usage_data_counters/known_events/common.yml b/lib/gitlab/usage_data_counters/known_events/common.yml index 3db0482d38e..261d3b37783 100644 --- a/lib/gitlab/usage_data_counters/known_events/common.yml +++ b/lib/gitlab/usage_data_counters/known_events/common.yml @@ -4,27 +4,22 @@ redis_slot: compliance category: compliance aggregation: weekly - feature_flag: track_unique_visits - name: g_compliance_audit_events category: compliance redis_slot: compliance aggregation: weekly - feature_flag: track_unique_visits - name: i_compliance_audit_events category: compliance redis_slot: compliance aggregation: weekly - feature_flag: track_unique_visits - name: i_compliance_credential_inventory category: compliance redis_slot: compliance aggregation: weekly - feature_flag: track_unique_visits - name: a_compliance_audit_events_api category: compliance redis_slot: compliance aggregation: weekly - feature_flag: track_unique_visits - name: g_edit_by_web_ide category: ide_edit redis_slot: edit @@ -67,7 +62,6 @@ - name: design_action category: source_code aggregation: daily - feature_flag: usage_data_design_action - name: project_action category: source_code aggregation: daily @@ -160,7 +154,6 @@ category: testing redis_slot: testing aggregation: weekly - feature_flag: usage_data_i_testing_metrics_report_widget_total - name: i_testing_group_code_coverage_visit_total category: testing redis_slot: testing @@ -174,7 +167,6 @@ category: testing redis_slot: testing aggregation: weekly - feature_flag: usage_data_i_testing_web_performance_widget_total - name: i_testing_group_code_coverage_project_click_total category: testing redis_slot: testing @@ -183,7 +175,6 @@ category: testing redis_slot: testing aggregation: weekly - feature_flag: usage_data_i_testing_load_performance_widget_total - name: i_testing_metrics_report_artifact_uploaders category: testing redis_slot: testing diff --git a/lib/gitlab/usage_data_counters/known_events/quickactions.yml b/lib/gitlab/usage_data_counters/known_events/quickactions.yml index 7df351859fb..7f77fa8ee02 100644 --- a/lib/gitlab/usage_data_counters/known_events/quickactions.yml +++ b/lib/gitlab/usage_data_counters/known_events/quickactions.yml @@ -3,6 +3,10 @@ category: quickactions redis_slot: quickactions aggregation: weekly +- name: i_quickactions_unapprove + category: quickactions + redis_slot: quickactions + aggregation: weekly - name: i_quickactions_assign_single category: quickactions redis_slot: quickactions diff --git a/lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb b/lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb index 0d6f4b93aee..0fadd68aeab 100644 --- a/lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb +++ b/lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb @@ -20,8 +20,10 @@ module Gitlab MR_CREATE_MULTILINE_COMMENT_ACTION = 'i_code_review_user_create_multiline_mr_comment' MR_EDIT_MULTILINE_COMMENT_ACTION = 'i_code_review_user_edit_multiline_mr_comment' MR_REMOVE_MULTILINE_COMMENT_ACTION = 'i_code_review_user_remove_multiline_mr_comment' - MR_ADD_SUGGESTION_ACTION = 'i_code_review_user_add_suggestion' - MR_APPLY_SUGGESTION_ACTION = 'i_code_review_user_apply_suggestion' + MR_USER_ADD_SUGGESTION_ACTION = 'i_code_review_user_add_suggestion' + MR_TOTAL_ADD_SUGGESTION_ACTION = 'i_code_review_total_suggestions_added' + MR_USER_APPLY_SUGGESTION_ACTION = 'i_code_review_user_apply_suggestion' + MR_TOTAL_APPLY_SUGGESTION_ACTION = 'i_code_review_total_suggestions_applied' MR_MARKED_AS_DRAFT_ACTION = 'i_code_review_user_marked_as_draft' MR_UNMARKED_AS_DRAFT_ACTION = 'i_code_review_user_unmarked_as_draft' MR_RESOLVE_THREAD_ACTION = 'i_code_review_user_resolve_thread' @@ -46,6 +48,7 @@ module Gitlab MR_LABELS_CHANGED_ACTION = 'i_code_review_user_labels_changed' MR_LOAD_CONFLICT_UI_ACTION = 'i_code_review_user_load_conflict_ui' MR_RESOLVE_CONFLICT_ACTION = 'i_code_review_user_resolve_conflict' + MR_RESOLVE_THREAD_IN_ISSUE_ACTION = 'i_code_review_user_resolve_thread_in_issue' class << self def track_mr_diffs_action(merge_request:) @@ -112,8 +115,9 @@ module Gitlab track_unique_action_by_user(MR_PUBLISH_REVIEW_ACTION, user) end - def track_add_suggestion_action(user:) - track_unique_action_by_user(MR_ADD_SUGGESTION_ACTION, user) + def track_add_suggestion_action(note:) + track_unique_action_by_user(MR_USER_ADD_SUGGESTION_ACTION, note.author) + track_unique_action_by_objects(MR_TOTAL_ADD_SUGGESTION_ACTION, note.suggestions) end def track_marked_as_draft_action(user:) @@ -124,16 +128,17 @@ module Gitlab track_unique_action_by_user(MR_UNMARKED_AS_DRAFT_ACTION, user) end - def track_apply_suggestion_action(user:) - track_unique_action_by_user(MR_APPLY_SUGGESTION_ACTION, user) + def track_apply_suggestion_action(user:, suggestions:) + track_unique_action_by_user(MR_USER_APPLY_SUGGESTION_ACTION, user) + track_unique_action_by_objects(MR_TOTAL_APPLY_SUGGESTION_ACTION, suggestions) end def track_users_assigned_to_mr(users:) - track_unique_action_by_users(MR_ASSIGNED_USERS_ACTION, users) + track_unique_action_by_objects(MR_ASSIGNED_USERS_ACTION, users) end def track_users_review_requested(users:) - track_unique_action_by_users(MR_REVIEW_REQUESTED_USERS_ACTION, users) + track_unique_action_by_objects(MR_REVIEW_REQUESTED_USERS_ACTION, users) end def track_title_edit_action(user:) @@ -210,6 +215,10 @@ module Gitlab track_unique_action_by_user(MR_RESOLVE_CONFLICT_ACTION, user) end + def track_resolve_thread_in_issue_action(user:) + track_unique_action_by_user(MR_RESOLVE_THREAD_IN_ISSUE_ACTION, user) + end + private def track_unique_action_by_merge_request(action, merge_request) @@ -222,10 +231,10 @@ module Gitlab track_unique_action(action, user.id) end - def track_unique_action_by_users(action, users) - return if users.blank? + def track_unique_action_by_objects(action, objects) + return if objects.blank? - track_unique_action(action, users.map(&:id)) + track_unique_action(action, objects.map(&:id)) end def track_unique_action(action, value) |