Add uuid to usage ping

parent a8441c99
module Gitlab module Gitlab
class UsageData class UsageData
include Gitlab::CurrentSettings
class << self class << self
def data(force_refresh: false) def data(force_refresh: false)
Rails.cache.fetch('usage_data', force: force_refresh, expires_in: 2.weeks) { uncached_data } Rails.cache.fetch('usage_data', force: force_refresh, expires_in: 2.weeks) { uncached_data }
...@@ -51,7 +53,8 @@ module Gitlab ...@@ -51,7 +53,8 @@ module Gitlab
end end
def license_usage_data def license_usage_data
usage_data = { version: Gitlab::VERSION, usage_data = { uuid: current_application_settings.uuid,
version: Gitlab::VERSION,
active_user_count: User.active.count, active_user_count: User.active.count,
mattermost_enabled: Gitlab.config.mattermost.enabled } mattermost_enabled: Gitlab.config.mattermost.enabled }
......
...@@ -22,6 +22,7 @@ describe Gitlab::UsageData do ...@@ -22,6 +22,7 @@ describe Gitlab::UsageData do
recorded_at recorded_at
version version
mattermost_enabled mattermost_enabled
uuid
)) ))
end end
...@@ -72,6 +73,7 @@ describe Gitlab::UsageData do ...@@ -72,6 +73,7 @@ describe Gitlab::UsageData do
it "gathers license data" do it "gathers license data" do
license = ::License.current license = ::License.current
expect(subject[:uuid]).to eq(current_application_settings.uuid)
expect(subject[:license_md5]).to eq(Digest::MD5.hexdigest(license.data)) expect(subject[:license_md5]).to eq(Digest::MD5.hexdigest(license.data))
expect(subject[:version]).to eq(Gitlab::VERSION) expect(subject[:version]).to eq(Gitlab::VERSION)
expect(subject[:licensee]).to eq(license.licensee) expect(subject[:licensee]).to eq(license.licensee)
......
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