Use the same suffix for count attributes on GeoNodeStatus

parent 11818fe7
......@@ -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
......
......@@ -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
......
......@@ -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 =
......
......@@ -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
......
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