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
5a8337a4
Commit
5a8337a4
authored
Mar 16, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use the same suffix for count attributes on GeoNodeStatus
parent
11818fe7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
14 deletions
+21
-14
app/models/geo_node_status.rb
app/models/geo_node_status.rb
+9
-9
app/serializers/geo_node_status_entity.rb
app/serializers/geo_node_status_entity.rb
+2
-2
app/services/geo/node_status_service.rb
app/services/geo/node_status_service.rb
+8
-1
lib/api/entities.rb
lib/api/entities.rb
+2
-2
No files found.
app/models/geo_node_status.rb
View file @
5a8337a4
...
...
@@ -40,24 +40,24 @@ class GeoNodeStatus
@repositories_failed_count
=
value
.
to_i
end
def
lfs_objects_
total
@lfs_objects_
total
||=
LfsObject
.
count
def
lfs_objects_
count
@lfs_objects_
count
||=
LfsObject
.
count
end
def
lfs_objects_
total
=
(
value
)
@lfs_objects_
total
=
value
.
to_i
def
lfs_objects_
count
=
(
value
)
@lfs_objects_
count
=
value
.
to_i
end
def
lfs_objects_synced
@lfs_objects_synced
||=
Geo
::
FileRegistry
.
where
(
file_type: :lfs
).
count
def
lfs_objects_synced
_count
@lfs_objects_synced
_count
||=
Geo
::
FileRegistry
.
where
(
file_type: :lfs
).
count
end
def
lfs_objects_synced
=
(
value
)
@lfs_objects_synced
=
value
.
to_i
def
lfs_objects_synced
_count
=
(
value
)
@lfs_objects_synced
_count
=
value
.
to_i
end
def
lfs_objects_synced_in_percentage
sync_percentage
(
lfs_objects_
total
,
lfs_objects_synced
)
sync_percentage
(
lfs_objects_
count
,
lfs_objects_synced_count
)
end
private
...
...
app/serializers/geo_node_status_entity.rb
View file @
5a8337a4
...
...
@@ -8,8 +8,8 @@ class GeoNodeStatusEntity < Grape::Entity
node
.
healthy?
?
'No Health Problems Detected'
:
node
.
health
end
expose
:lfs_objects_
total
,
as: :lfs_objects_
count
expose
:lfs_objects_synced
,
as: :lfs_objects_synced
_count
expose
:lfs_objects_count
expose
:lfs_objects_synced_count
expose
:lfs_objects_synced_in_percentage
do
|
node
|
number_to_percentage
(
node
.
lfs_objects_synced_in_percentage
,
precision:
2
)
end
...
...
app/services/geo/node_status_service.rb
View file @
5a8337a4
...
...
@@ -3,7 +3,14 @@ module Geo
include
Gitlab
::
CurrentSettings
include
HTTParty
KEYS
=
%w(health repositories_count repositories_synced_count repositories_failed_count lfs_objects_total lfs_objects_synced)
.
freeze
KEYS
=
%w(
health
repositories_count
repositories_synced_count
repositories_failed_count
lfs_objects_count
lfs_objects_synced_count
)
.
freeze
def
call
(
geo_node
)
values
=
...
...
lib/api/entities.rb
View file @
5a8337a4
...
...
@@ -782,8 +782,8 @@ module API
expose
:repositories_count
expose
:repositories_synced_count
expose
:repositories_failed_count
expose
:lfs_objects_
total
expose
:lfs_objects_synced
expose
:lfs_objects_
count
expose
:lfs_objects_synced
_count
end
class
PersonalAccessToken
<
Grape
::
Entity
...
...
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