rename lib/{model_context_protocol => mcp}
This commit is contained in:
parent
a09f4786b4
commit
9d2447b351
1 changed files with 62 additions and 63 deletions
|
|
@ -1,26 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ModelContextProtocol
|
||||
module Instrumentation
|
||||
def instrument_call(method, &block)
|
||||
start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
||||
begin
|
||||
@instrumentation_data = {}
|
||||
add_instrumentation_data(method:)
|
||||
|
||||
result = yield block
|
||||
|
||||
result
|
||||
ensure
|
||||
end_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
||||
add_instrumentation_data(duration: end_time - start_time)
|
||||
|
||||
configuration.instrumentation_callback.call(@instrumentation_data)
|
||||
end
|
||||
end
|
||||
|
||||
def add_instrumentation_data(**kwargs)
|
||||
@instrumentation_data.merge!(kwargs)
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Reference in a new issue