builder_apm 0.5.11 → 0.5.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 02760fa88241646b4ddb87a554d821ecf18890d0e9c4d70dcceffd1b46b2778a
4
- data.tar.gz: 4ebd515ffcfad5572b968698223e1aafbe625c53bfb3c1a59540e9f6ba832933
3
+ metadata.gz: 7c38b8b9147a7d924e00fdcff0bb60fbd574e5f599143f035e1bf6142a67989e
4
+ data.tar.gz: c8a37f136b74dadb9cf3f7e65227ed142192dbc11cb3a9f3c7cf946db75a1767
5
5
  SHA512:
6
- metadata.gz: e9c141994b8b2afc5c623a88b8edc5138448ef34ed61405afd7f0d5f42454f1575366e73a179ef4a1819245818b060886474bdbeb38eec31bcd809443d63d357
7
- data.tar.gz: 516d69507027b4fd00edb38b79299cb92b30e6561442742b28e14c34f32efd53cc01c21fc7122a262fcce38d227fa21ddb1e8b1495f57fa5083662885e72f127
6
+ metadata.gz: 4f6b7711e21ccc97bdbe51e79db6a7b01a356673e0b3af9281c6595c401a34b124d19dd3ca79ea8151517d0aa6ad6bda1133e2e33ba0d35e84464fa2b8c9072c
7
+ data.tar.gz: 3f1e052b4e14cc60513a020a57732931c7b0b0e50bbadac80a2432f3fd8045fe6cfdf3b91cfd3043e8f80ab3da624607d37cf63c0b6328e4ff1c960d5e5778d3
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- builder_apm (0.4.2)
4
+ builder_apm (0.5.12)
5
5
  rails (>= 4.0, < 8)
6
- redis (~> 4.5)
6
+ redis (>= 4.5)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
@@ -10,7 +10,7 @@ module BuilderApm
10
10
 
11
11
  def initialize(api_key)
12
12
  @api_key = api_key
13
- @uri = URI.parse("https://models-gateway.builder.ai/api/v1/openai/deployments/gpt-35-turbo/chat/completions")
13
+ @uri = URI.parse("https://models-gateway.builder.ai/api/v1/openai/deployments/gpt-35-turbo-16k-0613/chat/completions")
14
14
  @role = "You are to be my assistant"
15
15
  @temperature = 0.2
16
16
  end
@@ -5,6 +5,7 @@ module BuilderApm
5
5
  initializer 'builder_apm.start' do |app|
6
6
  BuilderApm::Controllers::Instrumenter.new.start
7
7
  BuilderApm::Models::Instrumenter.start if BuilderApm.configuration.enable_active_record_profiler
8
+ BuilderApm::Methods::Instrumenter.new.start if BuilderApm.configuration.enable_methods_profiler
8
9
  end
9
10
 
10
11
  config.after_initialize do
@@ -21,7 +21,7 @@ module BuilderApm
21
21
  me = self
22
22
  TracePoint.new(:call, :return, :end, :raise) do |tp|
23
23
  starttime = Time.now.to_f * 1000
24
- me.process_trace_point(tp) if me.valid_trace_point?(tp)
24
+ me.process_trace_point(tp) if Thread.current[:request_id] && me.valid_trace_point?(tp)
25
25
  duration = (Time.now.to_f * 1000) - starttime
26
26
 
27
27
  Thread.current[:method_tracing] = (Thread.current[:method_tracing] ||= 0) + duration
@@ -30,7 +30,6 @@ module BuilderApm
30
30
 
31
31
  def valid_trace_point?(tp)
32
32
  return false unless tp.path.start_with?(@root_path)
33
- return false unless Thread.current[:request_id]
34
33
 
35
34
  start_controller = Thread.current[:stack]&.first
36
35
  start_controller && "#{tp.defined_class}##{tp.method_id}" != start_controller[:method]
@@ -17,12 +17,10 @@ module BuilderApm
17
17
  Thread.current[:db_tracing] = 0
18
18
  Thread.current[:trace_point].disable if Thread.current[:trace_point]
19
19
  Thread.current[:trace_point] = nil
20
- BuilderApm::Methods::Instrumenter.new.start if BuilderApm.configuration.enable_methods_profiler
21
20
 
22
21
  @status, @headers, @response = @app.call(env)
23
22
 
24
23
  ensure
25
- Thread.current[:trace_point].disable if Thread.current[:trace_point]
26
24
  end_time = Time.now.to_f * 1000
27
25
  handle_timing(start_time, end_time, request_id)
28
26
 
@@ -1,3 +1,3 @@
1
1
  module BuilderApm
2
- VERSION = "0.5.11"
2
+ VERSION = "0.5.13"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: builder_apm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.11
4
+ version: 0.5.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Ketelle
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-09-27 00:00:00.000000000 Z
11
+ date: 2023-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails