lib/gitlab/usage_data/topology.rb
# Given a hash mapping memory set types to Prometheus response data, returns a hash
# mapping instance/node names to services and their respective memory use in bytes
Given a hash mapping memory set types to Prometheus response data, returns a hash
mapping instance/node names to services and their respective memory use in bytes
Given a hash mapping memory set types to Prometheus response data returns a hash mapping instance / node names to services and their respective memory use in bytes
def topology_instance_service_memory(instance, instance_data_by_type)
        result = {}
        instance_data_by_type.each do |memory_type, instance_data|
          topology_data_for_instance(instance, instance_data).each do |metric, memory_bytes|
            job = metric['job']
            key = "process_memory_#{memory_type}".to_sym
            result[job] ||= {}
            result[job][key] ||= memory_bytes
          end
        end
        result
      end
def topology_instance_service_memory ( instance , instance_data_by_type ) result = { } instance_data_by_type . each do | memory_type , instance_data | topology_data_for_instance ( instance , instance_data ) . each do | metric , memory_bytes | job = metric [ 'job' ] key = "process_memory_#{memory_type}" . to_sym result [ job ] ||= { } result [ job ] [ key ] ||= memory_bytes end end result end
Given a hash mapping memory set types to Prometheus response data, returns a hash
mapping instance/node names to services and their respective memory use in bytes
Given a hash mapping memory set types to Prometheus response data returns a hash mapping instance / node names to services and their respective memory use in bytes
instance
<not_specific>
instance_data_by_type
<not_specific>