File tree Expand file tree Collapse file tree 7 files changed +15
-41
lines changed
Expand file tree Collapse file tree 7 files changed +15
-41
lines changed Original file line number Diff line number Diff line change 1717name : Ruby
1818
1919on :
20+ pull_request :
2021 push :
2122 branches :
2223 - main
24+ schedule :
25+ - cron : ' 0 18 * * *'
2326
2427jobs :
2528 build :
Original file line number Diff line number Diff line change 2929 value = redis . get ( "hello" )
3030 puts "Value of 'hello': #{ value } "
3131 "Hello #{ params [ :name ] } !"
32- end
33-
34-
35-
36-
37-
38-
32+ end
Original file line number Diff line number Diff line change @@ -62,10 +62,6 @@ def started?
6262 def config
6363 @config ||= Configuration . new . agent_config
6464 end
65-
66- def segment_signal_ready
67- @agent &.reporter &.signal_ready
68- end
6965 end
7066
7167 attr_reader :plugins , :logger , :reporter
Original file line number Diff line number Diff line change @@ -52,21 +52,20 @@ def close_queue
5252 @closed = true
5353 end
5454 end
55-
55+
5656 def closed?
57- @mutex . synchronize do
58- @closed
59- end
57+ @closed
6058 end
6159
6260 def stream_data
63- return enum_for ( :stream_data ) unless block_given?
64-
65- until closed?
61+ begin
6662 segment = @buffer . pop ( false )
67- unless segment . nil?
68- yield ( generate_segment ( segment ) )
69- end
63+ rescue ThreadError
64+ return nil
65+ end
66+
67+ Enumerator . new do |yie |
68+ yie << generate_segment ( segment ) unless segment . nil?
7069 end
7170 end
7271
Original file line number Diff line number Diff line change @@ -41,11 +41,6 @@ def report_heartbeat
4141 def report_segment ( enumerator )
4242 @trace_client . report_segment ( enumerator )
4343 end
44-
45- def shutdown
46- @ms_client . close
47- @trace_client . close
48- end
4944 end
5045 end
5146end
Original file line number Diff line number Diff line change @@ -22,8 +22,6 @@ module Reporter
2222 class Report
2323 def initialize ( config )
2424 @config = config
25- @mutex = Mutex . new
26- @condition = ConditionVariable . new
2725 init_proto
2826 end
2927
@@ -49,19 +47,10 @@ def init_reporter
4947
5048 @@trigger = BufferTrigger . new ( @config )
5149 @daemon_loop << Thread . new do
52- @mutex . synchronize do
53- @condition . wait ( @mutex )
54- end
5550 report_segment
5651 end
5752 end
58-
59- def signal_ready
60- @mutex . synchronize do
61- @condition . signal
62- end
63- end
64-
53+
6554 def self . trigger
6655 @@trigger
6756 end
@@ -79,15 +68,14 @@ def stop
7968 daemon . join
8069 end
8170 end
82- @protocol . shutdown
8371 end
8472
8573 def report_heartbeat
8674 @protocol . report_heartbeat
8775 end
8876
8977 def report_segment
90- @protocol . report_segment ( @@trigger . stream_data )
78+ @protocol . report_segment ( @@trigger . stream_data ) until @@trigger . closed?
9179 end
9280 end
9381 end
Original file line number Diff line number Diff line change @@ -148,7 +148,6 @@ def stop?(span)
148148 @n_spans -= 1
149149 if @n_spans . zero?
150150 Reporter ::Report . trigger << @segment
151- Agent . segment_signal_ready
152151 return true
153152 end
154153
You can’t perform that action at this time.
0 commit comments