Use the same suffix for count attributes on GeoNodeStatus

parent 11818fe7
...@@ -40,24 +40,24 @@ class GeoNodeStatus ...@@ -40,24 +40,24 @@ class GeoNodeStatus
@repositories_failed_count = value.to_i @repositories_failed_count = value.to_i
end end
def lfs_objects_total def lfs_objects_count
@lfs_objects_total ||= LfsObject.count @lfs_objects_count ||= LfsObject.count
end end
def lfs_objects_total=(value) def lfs_objects_count=(value)
@lfs_objects_total = value.to_i @lfs_objects_count = value.to_i
end end
def lfs_objects_synced def lfs_objects_synced_count
@lfs_objects_synced ||= Geo::FileRegistry.where(file_type: :lfs).count @lfs_objects_synced_count ||= Geo::FileRegistry.where(file_type: :lfs).count
end end
def lfs_objects_synced=(value) def lfs_objects_synced_count=(value)
@lfs_objects_synced = value.to_i @lfs_objects_synced_count = value.to_i
end end
def lfs_objects_synced_in_percentage def lfs_objects_synced_in_percentage
sync_percentage(lfs_objects_total, lfs_objects_synced) sync_percentage(lfs_objects_count, lfs_objects_synced_count)
end end
private private
......
...@@ -8,8 +8,8 @@ class GeoNodeStatusEntity < Grape::Entity ...@@ -8,8 +8,8 @@ class GeoNodeStatusEntity < Grape::Entity
node.healthy? ? 'No Health Problems Detected' : node.health node.healthy? ? 'No Health Problems Detected' : node.health
end end
expose :lfs_objects_total, as: :lfs_objects_count expose :lfs_objects_count
expose :lfs_objects_synced, as: :lfs_objects_synced_count expose :lfs_objects_synced_count
expose :lfs_objects_synced_in_percentage do |node| expose :lfs_objects_synced_in_percentage do |node|
number_to_percentage(node.lfs_objects_synced_in_percentage, precision: 2) number_to_percentage(node.lfs_objects_synced_in_percentage, precision: 2)
end end
......
...@@ -3,7 +3,14 @@ module Geo ...@@ -3,7 +3,14 @@ module Geo
include Gitlab::CurrentSettings include Gitlab::CurrentSettings
include HTTParty 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) def call(geo_node)
values = values =
......
...@@ -782,8 +782,8 @@ module API ...@@ -782,8 +782,8 @@ module API
expose :repositories_count expose :repositories_count
expose :repositories_synced_count expose :repositories_synced_count
expose :repositories_failed_count expose :repositories_failed_count
expose :lfs_objects_total expose :lfs_objects_count
expose :lfs_objects_synced expose :lfs_objects_synced_count
end end
class PersonalAccessToken < Grape::Entity class PersonalAccessToken < Grape::Entity
......
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