Commit f062489e authored by Sean McGivern's avatar Sean McGivern

Merge branch 'ccr/48800/ping_for_boards' into 'master'

Added count for label, assignee, and milestone lists

Closes #48800

See merge request gitlab-org/gitlab-ce!21208
parents 1d71d504 e9c1f184
---
title: Adds count for different board list types (label lists, assignee lists, and
milestone lists) to usage statistics.
merge_request: 21208
author:
type: changed
# frozen_string_literal: true
class AddIndexOnListType < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_index :lists, :list_type
end
def down
remove_concurrent_index :lists, :list_type
end
end
......@@ -1135,6 +1135,7 @@ ActiveRecord::Schema.define(version: 20180816193530) do
add_index "lists", ["board_id", "label_id"], name: "index_lists_on_board_id_and_label_id", unique: true, using: :btree
add_index "lists", ["label_id"], name: "index_lists_on_label_id", using: :btree
add_index "lists", ["list_type"], name: "index_lists_on_list_type", using: :btree
create_table "members", force: :cascade do |t|
t.integer "access_level", null: false
......
......@@ -34,6 +34,7 @@ module Gitlab
def system_usage_data
{
counts: {
assignee_lists: List.assignee.count,
boards: Board.count,
ci_builds: ::Ci::Build.count,
ci_internal_pipelines: ::Ci::Pipeline.internal.count,
......@@ -61,9 +62,11 @@ module Gitlab
groups: Group.count,
issues: Issue.count,
keys: Key.count,
label_lists: List.label.count,
labels: Label.count,
lfs_objects: LfsObject.count,
merge_requests: MergeRequest.count,
milestone_lists: List.milestone.count,
milestones: Milestone.count,
notes: Note.count,
pages_domains: PagesDomain.count,
......
......@@ -56,6 +56,7 @@ describe Gitlab::UsageData do
expect(count_data[:projects]).to eq(3)
expect(count_data.keys).to match_array(%i(
assignee_lists
boards
ci_builds
ci_internal_pipelines
......@@ -83,9 +84,11 @@ describe Gitlab::UsageData do
groups
issues
keys
label_lists
labels
lfs_objects
merge_requests
milestone_lists
milestones
notes
projects
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment