Commit dc63b952 authored by Sean McGivern's avatar Sean McGivern

Add edition to usage ping

parent adf48b90
...@@ -72,12 +72,14 @@ module Gitlab ...@@ -72,12 +72,14 @@ module Gitlab
version: Gitlab::VERSION, version: Gitlab::VERSION,
active_user_count: User.active.count, active_user_count: User.active.count,
recorded_at: Time.now, recorded_at: Time.now,
mattermost_enabled: Gitlab.config.mattermost.enabled mattermost_enabled: Gitlab.config.mattermost.enabled,
edition: 'EE'
} }
license = ::License.current license = ::License.current
if license if license
usage_data[:edition] = license_edition(license.plan)
usage_data[:license_md5] = Digest::MD5.hexdigest(license.data) usage_data[:license_md5] = Digest::MD5.hexdigest(license.data)
usage_data[:historical_max_users] = ::HistoricalData.max_historical_user_count usage_data[:historical_max_users] = ::HistoricalData.max_historical_user_count
usage_data[:licensee] = license.licensee usage_data[:licensee] = license.licensee
...@@ -89,6 +91,17 @@ module Gitlab ...@@ -89,6 +91,17 @@ module Gitlab
usage_data usage_data
end end
def license_edition(plan)
case plan
when 'premium'
'EEP'
when 'starter'
'EES'
when nil # Older licenses
'EE'
end
end
end end
end end
end end
...@@ -20,8 +20,9 @@ describe Gitlab::UsageData do ...@@ -20,8 +20,9 @@ describe Gitlab::UsageData do
licensee licensee
license_md5 license_md5
recorded_at recorded_at
version
mattermost_enabled mattermost_enabled
edition
version
uuid uuid
)) ))
end end
......
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