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
7ff56557
Commit
7ff56557
authored
May 26, 2017
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ActiveUsers Check
parent
93e08446
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
60 deletions
+19
-60
lib/system_check/app/active_users_check.rb
lib/system_check/app/active_users_check.rb
+17
-0
lib/tasks/gitlab/check.rake
lib/tasks/gitlab/check.rake
+2
-60
No files found.
lib/system_check/app/active_users_check.rb
0 → 100644
View file @
7ff56557
module
SystemCheck
module
App
class
ActiveUsersCheck
<
SystemCheck
::
BaseCheck
set_name
'Active users:'
def
multi_check
active_users
=
User
.
active
.
count
if
active_users
>
0
$stdout
.
puts
active_users
.
to_s
.
color
(
:green
)
else
$stdout
.
puts
active_users
.
to_s
.
color
(
:red
)
end
end
end
end
end
lib/tasks/gitlab/check.rake
View file @
7ff56557
...
...
@@ -32,11 +32,11 @@ namespace :gitlab do
SystemCheck
::
App
::
ProjectsHaveNamespaceCheck
,
SystemCheck
::
App
::
RedisVersionCheck
,
SystemCheck
::
App
::
RubyVersionCheck
,
SystemCheck
::
App
::
GitVersionCheck
SystemCheck
::
App
::
GitVersionCheck
,
SystemCheck
::
App
::
ActiveUsersCheck
]
SystemCheck
.
run
(
'GitLab'
,
checks
)
check_active_users
check_elasticsearch
if
current_application_settings
.
elasticsearch_indexing?
end
end
...
...
@@ -606,36 +606,6 @@ namespace :gitlab do
# Helper methods
##########################
# @deprecated Please use SystemChecks
def
fix_and_rerun
puts
" Please fix the error above and rerun the checks."
.
color
(
:red
)
end
# @deprecated Please use SystemChecks
def
for_more_information
(
*
sources
)
sources
=
sources
.
shift
if
sources
.
first
.
is_a?
(
Array
)
puts
" For more information see:"
.
color
(
:blue
)
sources
.
each
do
|
source
|
puts
"
#{
source
}
"
end
end
# @deprecated Please use SystemChecks
def
finished_checking
(
component
)
puts
""
puts
"Checking
#{
component
.
color
(
:yellow
)
}
...
#{
"Finished"
.
color
(
:green
)
}
"
puts
""
end
def
see_database_guide
"doc/install/databases.md"
end
def
see_installation_guide_section
(
section
)
"doc/install/installation.md in section
\"
#{
section
}
\"
"
end
def
see_geo_features_page
'https://about.gitlab.com/features/gitlab-geo/'
end
...
...
@@ -648,30 +618,6 @@ namespace :gitlab do
'https://docs.gitlab.com/omnibus/common_installation_problems/README.html#using-self-signed-certificate-or-custom-certificate-authorities'
end
def
sudo_gitlab
(
command
)
"sudo -u
#{
gitlab_user
}
-H
#{
command
}
"
end
def
gitlab_user
Gitlab
.
config
.
gitlab
.
user
end
# @deprecated Please use SystemChecks
def
start_checking
(
component
)
puts
"Checking
#{
component
.
color
(
:yellow
)
}
..."
puts
""
end
# @deprecated Please use SystemChecks
def
try_fixing_it
(
*
steps
)
steps
=
steps
.
shift
if
steps
.
first
.
is_a?
(
Array
)
puts
" Try fixing it:"
.
color
(
:blue
)
steps
.
each
do
|
step
|
puts
"
#{
step
}
"
end
end
def
check_gitlab_shell
required_version
=
Gitlab
::
VersionInfo
.
new
(
gitlab_shell_major_version
,
gitlab_shell_minor_version
,
gitlab_shell_patch_version
)
current_version
=
Gitlab
::
VersionInfo
.
parse
(
gitlab_shell_version
)
...
...
@@ -684,10 +630,6 @@ namespace :gitlab do
end
end
def
check_active_users
puts
"Active users:
#{
User
.
active
.
count
}
"
end
def
check_repo_integrity
(
repo_dir
)
puts
"
\n
Checking repo at
#{
repo_dir
.
color
(
:yellow
)
}
"
...
...
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