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
eb9f9bd6
Commit
eb9f9bd6
authored
Jun 21, 2018
by
Brett Walker
Committed by
Nick Thomas
Jun 21, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve "Geo: Add verification information to 'gitlab-rake geo:status'"
parent
a230d730
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
12 deletions
+53
-12
ee/lib/tasks/geo.rake
ee/lib/tasks/geo.rake
+52
-11
ee/spec/tasks/geo_rake_spec.rb
ee/spec/tasks/geo_rake_spec.rb
+1
-1
No files found.
ee/lib/tasks/geo.rake
View file @
eb9f9bd6
...
...
@@ -226,29 +226,62 @@ namespace :geo do
puts
end
print
'GitLab
v
ersion: '
.
rjust
(
COLUMN_WIDTH
)
print
'GitLab
V
ersion: '
.
rjust
(
COLUMN_WIDTH
)
puts
Gitlab
::
VERSION
print
'Geo Role: '
.
rjust
(
COLUMN_WIDTH
)
role
=
if
Gitlab
::
Geo
.
primary?
'Primary'
else
Gitlab
::
Geo
.
secondary?
?
'Secondary'
:
'unknown'
.
color
(
:yellow
)
end
puts
role
print
'Health Status: '
.
rjust
(
COLUMN_WIDTH
)
if
current_node_status
.
healthy?
puts
current_node_status
.
health_status
else
puts
current_node_status
.
health_status
.
color
(
:red
)
end
print
'Repositories: '
.
rjust
(
COLUMN_WIDTH
)
show_failed_value
(
current_node_status
.
repositories_failed_count
)
print
"
#{
current_node_status
.
repositories_synced_count
}
/
#{
current_node_status
.
repositories_count
}
"
puts
"(
#{
number_to_percentage
(
current_node_status
.
repositories_synced_in_percentage
,
precision:
0
)
}
)"
puts
using_percentage
(
current_node_status
.
repositories_synced_in_percentage
)
if
Feature
.
enabled?
(
:geo_repository_verification
)
print
'Verified Repositories: '
.
rjust
(
COLUMN_WIDTH
)
show_failed_value
(
current_node_status
.
repositories_verification_failed_count
)
print
"
#{
current_node_status
.
repositories_verified_count
}
/
#{
current_node_status
.
repositories_count
}
"
puts
using_percentage
(
current_node_status
.
repositories_verified_in_percentage
)
end
print
'LFS objects: '
.
rjust
(
COLUMN_WIDTH
)
print
'Wikis: '
.
rjust
(
COLUMN_WIDTH
)
show_failed_value
(
current_node_status
.
wikis_failed_count
)
print
"
#{
current_node_status
.
wikis_synced_count
}
/
#{
current_node_status
.
wikis_count
}
"
puts
using_percentage
(
current_node_status
.
wikis_synced_in_percentage
)
if
Feature
.
enabled?
(
:geo_repository_verification
)
print
'Verified Wikis: '
.
rjust
(
COLUMN_WIDTH
)
show_failed_value
(
current_node_status
.
wikis_verification_failed_count
)
print
"
#{
current_node_status
.
wikis_verified_count
}
/
#{
current_node_status
.
wikis_count
}
"
puts
using_percentage
(
current_node_status
.
wikis_verified_in_percentage
)
end
print
'LFS Objects: '
.
rjust
(
COLUMN_WIDTH
)
show_failed_value
(
current_node_status
.
lfs_objects_failed_count
)
print
"
#{
current_node_status
.
lfs_objects_synced_count
}
/
#{
current_node_status
.
lfs_objects_count
}
"
puts
"(
#{
number_to_percentage
(
current_node_status
.
lfs_objects_synced_in_percentage
,
precision:
0
)
}
)"
puts
using_percentage
(
current_node_status
.
lfs_objects_synced_in_percentage
)
print
'Attachments: '
.
rjust
(
COLUMN_WIDTH
)
show_failed_value
(
current_node_status
.
attachments_failed_count
)
print
"
#{
current_node_status
.
attachments_synced_count
}
/
#{
current_node_status
.
attachments_count
}
"
puts
"(
#{
number_to_percentage
(
current_node_status
.
attachments_synced_in_percentage
,
precision:
0
)
}
)"
print
'Wikis: '
.
rjust
(
COLUMN_WIDTH
)
print
"
#{
current_node_status
.
wikis_synced_count
}
/
#{
current_node_status
.
wikis_count
}
"
puts
"(
#{
number_to_percentage
(
current_node_status
.
wikis_synced_in_percentage
,
precision:
0
)
}
)"
puts
using_percentage
(
current_node_status
.
attachments_synced_in_percentage
)
print
'Sync
s
ettings: '
.
rjust
(
COLUMN_WIDTH
)
print
'Sync
S
ettings: '
.
rjust
(
COLUMN_WIDTH
)
puts
geo_node
.
namespaces
.
any?
?
'Selective'
:
'Full'
print
'Database replication lag: '
.
rjust
(
COLUMN_WIDTH
)
...
...
@@ -287,4 +320,12 @@ namespace :geo do
puts
end
def
show_failed_value
(
value
)
print
"
#{
value
}
"
.
color
(
:red
)
+
'/'
if
value
>
0
end
def
using_percentage
(
value
)
"(
#{
number_to_percentage
(
value
.
floor
,
precision:
0
,
strip_insignificant_zeros:
true
)
}
)"
end
end
ee/spec/tasks/geo_rake_spec.rb
View file @
eb9f9bd6
...
...
@@ -71,7 +71,7 @@ describe 'geo rake tasks', :geo do
end
it
'runs with no error'
do
expect
{
run_rake_task
(
'geo:status'
)
}.
to
output
(
/Sync
s
ettings: Full/
).
to_stdout
expect
{
run_rake_task
(
'geo:status'
)
}.
to
output
(
/Sync
S
ettings: Full/
).
to_stdout
end
end
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