diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-06-27 13:53:12 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-06-27 13:53:12 +0300 |
commit | c00e5bfa065128c5212a991a5cfcb6f152981d51 (patch) | |
tree | c1c5e8011ff8dc640ed1310958325837184c92d9 | |
parent | 89f7f98eae43fcf750d479e804e42dab6e969562 (diff) | |
parent | e7d12a70d283b766cbcd4f417c293f34df10de3b (diff) |
Merge branch 'zj-review-apps-usage-data' into 'master'
Add review apps to usage ping
Closes #33171
See merge request !12185
-rw-r--r-- | app/models/environment.rb | 1 | ||||
-rw-r--r-- | changelogs/unreleased/zj-review-apps-usage-data.yml | 4 | ||||
-rw-r--r-- | lib/gitlab/usage_data.rb | 1 | ||||
-rw-r--r-- | spec/lib/gitlab/usage_data_spec.rb | 1 |
4 files changed, 7 insertions, 0 deletions
diff --git a/app/models/environment.rb b/app/models/environment.rb index 7ad36f1d80c..66c96d0f586 100644 --- a/app/models/environment.rb +++ b/app/models/environment.rb @@ -45,6 +45,7 @@ class Environment < ActiveRecord::Base .to_sql order(Gitlab::Database.nulls_first_order("(#{max_deployment_id_sql})", 'ASC')) end + scope :in_review_folder, -> { where(environment_type: "review") } state_machine :state, initial: :available do event :start do diff --git a/changelogs/unreleased/zj-review-apps-usage-data.yml b/changelogs/unreleased/zj-review-apps-usage-data.yml new file mode 100644 index 00000000000..7d224d0fc32 --- /dev/null +++ b/changelogs/unreleased/zj-review-apps-usage-data.yml @@ -0,0 +1,4 @@ +--- +title: Add review apps to usage metrics +merge_request: 12185 +author: diff --git a/lib/gitlab/usage_data.rb b/lib/gitlab/usage_data.rb index bcba2e3e1b6..38dc82493cf 100644 --- a/lib/gitlab/usage_data.rb +++ b/lib/gitlab/usage_data.rb @@ -27,6 +27,7 @@ module Gitlab deploy_keys: DeployKey.count, deployments: Deployment.count, environments: Environment.count, + in_review_folder: Environment.in_review_folder.count, groups: Group.count, issues: Issue.count, keys: Key.count, diff --git a/spec/lib/gitlab/usage_data_spec.rb b/spec/lib/gitlab/usage_data_spec.rb index b47e1b56fa9..3c7c7562b46 100644 --- a/spec/lib/gitlab/usage_data_spec.rb +++ b/spec/lib/gitlab/usage_data_spec.rb @@ -37,6 +37,7 @@ describe Gitlab::UsageData do deploy_keys deployments environments + in_review_folder groups issues keys |