Add in_review_folder to usage ping
As its hard to reliably check how many review apps there are on the clients machine, we start by checking where the type is `review`. This means the folder is called that way. This will lead to a seq scan on the table. However, this is done once a week, so the benefit of adding an index seems not to apply here.
This commit is contained in:
parent
6f5a68f528
commit
e7d12a70d2
|
@ -45,6 +45,7 @@ class Environment < ActiveRecord::Base
|
||||||
to_sql
|
to_sql
|
||||||
order(Gitlab::Database.nulls_first_order("(#{max_deployment_id_sql})", 'ASC'))
|
order(Gitlab::Database.nulls_first_order("(#{max_deployment_id_sql})", 'ASC'))
|
||||||
end
|
end
|
||||||
|
scope :in_review_folder, -> { where(environment_type: "review") }
|
||||||
|
|
||||||
state_machine :state, initial: :available do
|
state_machine :state, initial: :available do
|
||||||
event :start do
|
event :start do
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
title: Add review apps to usage metrics
|
||||||
|
merge_request: 12185
|
||||||
|
author:
|
|
@ -27,6 +27,7 @@ module Gitlab
|
||||||
deploy_keys: DeployKey.count,
|
deploy_keys: DeployKey.count,
|
||||||
deployments: Deployment.count,
|
deployments: Deployment.count,
|
||||||
environments: Environment.count,
|
environments: Environment.count,
|
||||||
|
in_review_folder: Environment.in_review_folder.count,
|
||||||
groups: Group.count,
|
groups: Group.count,
|
||||||
issues: Issue.count,
|
issues: Issue.count,
|
||||||
keys: Key.count,
|
keys: Key.count,
|
||||||
|
|
|
@ -37,6 +37,7 @@ describe Gitlab::UsageData do
|
||||||
deploy_keys
|
deploy_keys
|
||||||
deployments
|
deployments
|
||||||
environments
|
environments
|
||||||
|
in_review_folder
|
||||||
groups
|
groups
|
||||||
issues
|
issues
|
||||||
keys
|
keys
|
||||||
|
|
Loading…
Reference in New Issue