Sha256: fbc438e3a5ceba47b2609e2e81910194a2888dba4d3a9b3c8665c609111c961b
Contents?: true
Size: 1.02 KB
Versions: 11
Compression:
Stored size: 1.02 KB
Contents
# encoding: utf-8 # This file is distributed under New Relic's license terms. # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details. module NewRelic module Agent module MethodTracerHelpers MAX_ALLOWED_METRIC_DURATION = 1_000_000_000 # roughly 31 years extend self def trace_execution_scoped(metric_names, options=NewRelic::EMPTY_HASH) #THREAD_LOCAL_ACCESS state = NewRelic::Agent::Tracer.state return yield unless state.is_execution_traced? metric_names = Array(metric_names) first_name = metric_names.shift return yield unless first_name segment = NewRelic::Agent::Tracer.start_segment( name: first_name, unscoped_metrics: metric_names ) if options[:metric] == false segment.record_metrics = false end begin Tracer.capture_segment_error(segment) { yield } ensure segment.finish if segment end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems