File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,21 +7,29 @@ class FiberConnectionPool < Sequel::ConnectionPool
77 POOL_SIZE = 10
88
99 def log ( msg )
10+ otl_current_span { |span |
11+ span . add_event ( "Fiber:log" , attributes :{
12+ event : 'Success' , message : msg
13+ } . transform_keys ( &:to_s ) )
14+ }
15+
1016 return if defined? PERFORMANCE
1117 $stdout. puts "F:#{ Fiber . current . __id__ } : T:#{ Thread . current . __id__ } : A:#{ self . __id__ } : #{ msg } "
1218 # LOGGER.debug :fiber_pool, msg
1319 end
1420
1521 def initialize ( db , opts = OPTS )
16- super
17- @allocator = -> ( ) {
18- make_new ( :default ) . tap { |conn |
19- log "new connection (fiber pool) #{ conn } "
22+ otl_span "FiberConnectionPool.initialize" do |span |
23+ super
24+ @allocator = -> ( ) {
25+ make_new ( :default ) . tap { |conn |
26+ log "new connection (fiber pool) #{ conn } "
27+ }
2028 }
21- }
22- @stock = [ ]
23- @acquired = { }
24- @sp = Async :: Semaphore . new opts [ :max_connections ] || POOL_SIZE
29+ @stock = [ ]
30+ @acquired = { }
31+ @sp = Async :: Semaphore . new opts [ :max_connections ] || POOL_SIZE
32+ end
2533 end
2634
2735 def is_valid_connection? ( conn )
Original file line number Diff line number Diff line change 11module StackServiceBase
22 class Base
3- VERSION = '0.0.16 '
3+ VERSION = '0.0.17 '
44 end
55end
You can’t perform that action at this time.
0 commit comments