class ScoutApm::LayerConverters::AllocationMetricConverter

Public Instance Methods

record!() click to toggle source
# File lib/scout_apm/layer_converters/allocation_metric_converter.rb, line 4
def record!
  return unless scope_layer
  return unless ScoutApm::Instruments::Allocations::ENABLED

  meta = MetricMeta.new("ObjectAllocations", {:scope => scope_layer.legacy_metric_name})
  stat = MetricStats.new
  stat.update!(root_layer.total_allocations)
  metrics = { meta => stat }

  @store.track!(metrics)
  nil # not returning anything in the layer results ... not used
end