Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
3c383699
Commit
3c383699
authored
Mar 30, 2020
by
Adam Hegyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Usage data for customized VSM stages
parent
f143d46a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
3 deletions
+33
-3
db/migrate/20200330074719_add_index_for_group_vsm_usage_ping.rb
...rate/20200330074719_add_index_for_group_vsm_usage_ping.rb
+18
-0
db/structure.sql
db/structure.sql
+3
-0
ee/changelogs/unreleased/210369-usage-ping-for-customized-vsm.yml
...elogs/unreleased/210369-usage-ping-for-customized-vsm.yml
+5
-0
ee/lib/ee/gitlab/usage_data.rb
ee/lib/ee/gitlab/usage_data.rb
+2
-1
ee/spec/lib/ee/gitlab/usage_data_spec.rb
ee/spec/lib/ee/gitlab/usage_data_spec.rb
+5
-2
No files found.
db/migrate/20200330074719_add_index_for_group_vsm_usage_ping.rb
0 → 100644
View file @
3c383699
# frozen_string_literal: true
class
AddIndexForGroupVsmUsagePing
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
INDEX_NAME
=
'index_analytics_cycle_analytics_group_stages_custom_only'
disable_ddl_transaction!
def
up
add_concurrent_index
:analytics_cycle_analytics_group_stages
,
:id
,
where:
'custom = true'
,
name:
INDEX_NAME
end
def
down
remove_concurrent_index_by_name
:analytics_cycle_analytics_group_stages
,
INDEX_NAME
end
end
db/structure.sql
View file @
3c383699
...
@@ -8520,6 +8520,8 @@ CREATE INDEX index_analytics_ca_project_stages_on_relative_position ON public.an
...
@@ -8520,6 +8520,8 @@ CREATE INDEX index_analytics_ca_project_stages_on_relative_position ON public.an
CREATE
INDEX
index_analytics_ca_project_stages_on_start_event_label_id
ON
public
.
analytics_cycle_analytics_project_stages
USING
btree
(
start_event_label_id
);
CREATE
INDEX
index_analytics_ca_project_stages_on_start_event_label_id
ON
public
.
analytics_cycle_analytics_project_stages
USING
btree
(
start_event_label_id
);
CREATE
INDEX
index_analytics_cycle_analytics_group_stages_custom_only
ON
public
.
analytics_cycle_analytics_group_stages
USING
btree
(
id
)
WHERE
(
custom
=
true
);
CREATE
INDEX
index_application_settings_on_custom_project_templates_group_id
ON
public
.
application_settings
USING
btree
(
custom_project_templates_group_id
);
CREATE
INDEX
index_application_settings_on_custom_project_templates_group_id
ON
public
.
application_settings
USING
btree
(
custom_project_templates_group_id
);
CREATE
INDEX
index_application_settings_on_file_template_project_id
ON
public
.
application_settings
USING
btree
(
file_template_project_id
);
CREATE
INDEX
index_application_settings_on_file_template_project_id
ON
public
.
application_settings
USING
btree
(
file_template_project_id
);
...
@@ -12909,5 +12911,6 @@ COPY "schema_migrations" (version) FROM STDIN;
...
@@ -12909,5 +12911,6 @@ COPY "schema_migrations" (version) FROM STDIN;
20200326135443
20200326135443
20200326144443
20200326144443
20200326145443
20200326145443
20200330074719
\
.
\
.
ee/changelogs/unreleased/210369-usage-ping-for-customized-vsm.yml
0 → 100644
View file @
3c383699
---
title
:
Usage ping for customized Value Stream Management stage count
merge_request
:
28308
author
:
type
:
added
ee/lib/ee/gitlab/usage_data.rb
View file @
3c383699
...
@@ -244,7 +244,8 @@ module EE
...
@@ -244,7 +244,8 @@ module EE
groups:
distinct_count
(
::
GroupMember
.
where
(
time_period
),
:user_id
),
groups:
distinct_count
(
::
GroupMember
.
where
(
time_period
),
:user_id
),
ldap_keys:
distinct_count
(
::
LDAPKey
.
where
(
time_period
),
:user_id
),
ldap_keys:
distinct_count
(
::
LDAPKey
.
where
(
time_period
),
:user_id
),
ldap_users:
distinct_count
(
::
GroupMember
.
of_ldap_type
.
where
(
time_period
),
:user_id
),
ldap_users:
distinct_count
(
::
GroupMember
.
of_ldap_type
.
where
(
time_period
),
:user_id
),
users_created:
count
(
::
User
.
where
(
time_period
))
users_created:
count
(
::
User
.
where
(
time_period
)),
value_stream_management_customized_group_stages:
count
(
::
Analytics
::
CycleAnalytics
::
GroupStage
.
where
(
custom:
true
))
}
}
end
end
...
...
ee/spec/lib/ee/gitlab/usage_data_spec.rb
View file @
3c383699
...
@@ -384,6 +384,7 @@ describe Gitlab::UsageData do
...
@@ -384,6 +384,7 @@ describe Gitlab::UsageData do
create
(
:group_member
,
user:
user
)
create
(
:group_member
,
user:
user
)
create
(
:key
,
type:
'LDAPKey'
,
user:
user
)
create
(
:key
,
type:
'LDAPKey'
,
user:
user
)
create
(
:group_member
,
ldap:
true
,
user:
user
)
create
(
:group_member
,
ldap:
true
,
user:
user
)
create
(
:cycle_analytics_group_stage
)
end
end
expect
(
described_class
.
uncached_data
[
:usage_activity_by_stage
][
:manage
]).
to
eq
(
expect
(
described_class
.
uncached_data
[
:usage_activity_by_stage
][
:manage
]).
to
eq
(
...
@@ -391,14 +392,16 @@ describe Gitlab::UsageData do
...
@@ -391,14 +392,16 @@ describe Gitlab::UsageData do
groups:
2
,
groups:
2
,
ldap_keys:
2
,
ldap_keys:
2
,
ldap_users:
2
,
ldap_users:
2
,
users_created:
6
users_created:
6
,
value_stream_management_customized_group_stages:
2
)
)
expect
(
described_class
.
uncached_data
[
:usage_activity_by_stage_monthly
][
:manage
]).
to
eq
(
expect
(
described_class
.
uncached_data
[
:usage_activity_by_stage_monthly
][
:manage
]).
to
eq
(
events:
1
,
events:
1
,
groups:
1
,
groups:
1
,
ldap_keys:
1
,
ldap_keys:
1
,
ldap_users:
1
,
ldap_users:
1
,
users_created:
4
users_created:
4
,
value_stream_management_customized_group_stages:
2
)
)
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment