Module: DebugLogging::LambDarts::Benchmarked

Defined in:
lib/debug_logging/lamb_darts/benchmarked.rb

Instance Method Summary collapse

Instance Method Details

#_dl_ld_benchmarked(ld) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/debug_logging/lamb_darts/benchmarked.rb', line 4

def _dl_ld_benchmarked(ld)
  brv = nil
  # Benchmarking as close to the real mccoy as possible,
  #   so as to not pollute performance tracking with the effects of debug_logging,
  #   which may be removed once data has been gathered, or turned off.
  tms = Benchmark.measure do
    brv = yield
  end
  ld.config_proxy.log do
    "#{ld.end_timestamp}#{ld.log_prefix} #{ld.benchmarked(tms)}#{ld.invocation_id}"
  end
  brv
end