spec/support/custom_type_collector.rb
##
# The type collector here processes both polled and on-demand data, so we have to ensure key existence first
#
The type collector here processes both polled and on-demand data, so we have to ensure key existence first
The type collector here processes both polled and on - demand data so we have to ensure key existence first
def collect_metrics(data:, labels: {})
    logger.info "[gruf-prometheus] Received data and processing: #{data.inspect}"
    metric(:polled_total)&.observe(data['polled_total'], labels) if data.key?('polled_total')
    metric(:on_demand_total)&.observe(data['on_demand_total'], labels) if data.key?('on_demand_total')
  end
def collect_metrics ( data : , labels : { } ) logger . info "[gruf-prometheus] Received data and processing: #{data.inspect}" metric ( :polled_total ) &. observe ( data [ 'polled_total' ] , labels ) if data . key? ( 'polled_total' ) metric ( :on_demand_total ) &. observe ( data [ 'on_demand_total' ] , labels ) if data . key? ( 'on_demand_total' ) end
The type collector here processes both polled and on-demand data, so we have to ensure key existence first
The type collector here processes both polled and on - demand data so we have to ensure key existence first
data
<not_specific>
labels
<not_specific>