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
465b4ec5
Commit
465b4ec5
authored
Apr 19, 2017
by
Sean McGivern
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'usage-ping-back-back-ports' into 'master'
Usage ping back back ports See merge request !1587
parents
b30e44dc
e793a2d1
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
10 deletions
+30
-10
app/controllers/admin/application_settings_controller.rb
app/controllers/admin/application_settings_controller.rb
+1
-1
app/models/application_setting.rb
app/models/application_setting.rb
+2
-2
app/models/license.rb
app/models/license.rb
+4
-0
config/sidekiq_queues.yml
config/sidekiq_queues.yml
+1
-1
lib/gitlab/usage_data.rb
lib/gitlab/usage_data.rb
+20
-5
spec/lib/gitlab/usage_data_spec.rb
spec/lib/gitlab/usage_data_spec.rb
+2
-1
No files found.
app/controllers/admin/application_settings_controller.rb
View file @
465b4ec5
...
...
@@ -148,6 +148,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
:version_check_enabled
,
:terminal_max_session_time
,
:polling_interval_multiplier
,
:usage_ping_enabled
,
disabled_oauth_sign_in_sources:
[],
import_sources:
[],
...
...
@@ -169,7 +170,6 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
:elasticsearch_search
,
:repository_size_limit
,
:shared_runners_minutes
,
:usage_ping_enabled
,
:minimum_mirror_sync_time
,
:geo_status_timeout
,
:elasticsearch_experimental_indexer
,
...
...
app/models/application_setting.rb
View file @
465b4ec5
...
...
@@ -257,7 +257,8 @@ class ApplicationSetting < ActiveRecord::Base
terminal_max_session_time:
0
,
two_factor_grace_period:
48
,
user_default_external:
false
,
polling_interval_multiplier:
1
polling_interval_multiplier:
1
,
usage_ping_enabled:
true
}
end
...
...
@@ -266,7 +267,6 @@ class ApplicationSetting < ActiveRecord::Base
elasticsearch_url:
ENV
[
'ELASTIC_URL'
]
||
'http://localhost:9200'
,
elasticsearch_aws:
false
,
elasticsearch_aws_region:
ENV
[
'ELASTIC_REGION'
]
||
'us-east-1'
,
usage_ping_enabled:
true
,
minimum_mirror_sync_time:
Gitlab
::
Mirror
::
FIFTEEN
,
repository_size_limit:
0
}
...
...
app/models/license.rb
View file @
465b4ec5
...
...
@@ -99,6 +99,10 @@ class License < ActiveRecord::Base
restricted_attr
(
:previous_user_count
)
end
def
plan
restricted_attr
(
:plan
)
end
def
current_active_users_count
@current_active_users_count
||=
User
.
active
.
count
end
...
...
config/sidekiq_queues.yml
View file @
465b4ec5
...
...
@@ -53,6 +53,7 @@
- [default, 1]
- [pages, 1]
- [system_hook_push, 1]
- [update_user_activity, 1]
# EE specific queues
- [geo, 1]
- [project_mirror, 1]
...
...
@@ -63,4 +64,3 @@
- [elastic_indexer, 1]
- [elastic_commit_indexer, 1]
- [export_csv, 1]
- [update_user_activity, 1]
lib/gitlab/usage_data.rb
View file @
465b4ec5
...
...
@@ -67,14 +67,19 @@ module Gitlab
end
def
license_usage_data
usage_data
=
{
uuid:
current_application_settings
.
uuid
,
usage_data
=
{
uuid:
current_application_settings
.
uuid
,
version:
Gitlab
::
VERSION
,
active_user_count:
User
.
active
.
count
,
mattermost_enabled:
Gitlab
.
config
.
mattermost
.
enabled
}
recorded_at:
Time
.
now
,
mattermost_enabled:
Gitlab
.
config
.
mattermost
.
enabled
,
edition:
'EE'
}
license
=
::
License
.
current
if
license
usage_data
[
:edition
]
=
license_edition
(
license
.
plan
)
usage_data
[
:license_md5
]
=
Digest
::
MD5
.
hexdigest
(
license
.
data
)
usage_data
[
:historical_max_users
]
=
::
HistoricalData
.
max_historical_user_count
usage_data
[
:licensee
]
=
license
.
licensee
...
...
@@ -82,11 +87,21 @@ module Gitlab
usage_data
[
:license_starts_at
]
=
license
.
starts_at
usage_data
[
:license_expires_at
]
=
license
.
expires_at
usage_data
[
:license_add_ons
]
=
license
.
add_ons
usage_data
[
:recorded_at
]
=
Time
.
now
end
usage_data
end
def
license_edition
(
plan
)
case
plan
when
'premium'
'EEP'
when
'starter'
'EES'
else
# Older licenses
'EE'
end
end
end
end
end
spec/lib/gitlab/usage_data_spec.rb
View file @
465b4ec5
...
...
@@ -20,8 +20,9 @@ describe Gitlab::UsageData do
licensee
license_md5
recorded_at
version
mattermost_enabled
edition
version
uuid
)
)
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