Class: NewRelic::Agent::PipeService
- Inherits:
-
Object
- Object
- NewRelic::Agent::PipeService
- Defined in:
- lib/new_relic/agent/pipe_service.rb
Instance Attribute Summary collapse
-
#agent_id ⇒ Object
Returns the value of attribute agent_id.
-
#buffer ⇒ Object
readonly
Returns the value of attribute buffer.
-
#channel_id ⇒ Object
readonly
Returns the value of attribute channel_id.
-
#collector ⇒ Object
Returns the value of attribute collector.
-
#request_timeout ⇒ Object
Returns the value of attribute request_timeout.
Instance Method Summary collapse
- #connect(config) ⇒ Object
- #error_data(errors) ⇒ Object
- #get_agent_commands ⇒ Object
-
#initialize(channel_id) ⇒ PipeService
constructor
A new instance of PipeService.
- #metric_data(last_harvest_time, now, unsent_timeslice_data) ⇒ Object
- #shutdown(time) ⇒ Object
- #sql_trace_data(sql) ⇒ Object
- #transaction_sample_data(transactions) ⇒ Object
Constructor Details
#initialize(channel_id) ⇒ PipeService
Returns a new instance of PipeService.
7 8 9 10 11 |
# File 'lib/new_relic/agent/pipe_service.rb', line 7 def initialize(channel_id) @channel_id = channel_id @collector = NewRelic::Control::Server.new(:name => 'parent', :port => 0) end |
Instance Attribute Details
#agent_id ⇒ Object
Returns the value of attribute agent_id.
5 6 7 |
# File 'lib/new_relic/agent/pipe_service.rb', line 5 def agent_id @agent_id end |
#buffer ⇒ Object (readonly)
Returns the value of attribute buffer.
4 5 6 |
# File 'lib/new_relic/agent/pipe_service.rb', line 4 def buffer @buffer end |
#channel_id ⇒ Object (readonly)
Returns the value of attribute channel_id.
4 5 6 |
# File 'lib/new_relic/agent/pipe_service.rb', line 4 def channel_id @channel_id end |
#collector ⇒ Object
Returns the value of attribute collector.
5 6 7 |
# File 'lib/new_relic/agent/pipe_service.rb', line 5 def collector @collector end |
#request_timeout ⇒ Object
Returns the value of attribute request_timeout.
5 6 7 |
# File 'lib/new_relic/agent/pipe_service.rb', line 5 def request_timeout @request_timeout end |
Instance Method Details
#connect(config) ⇒ Object
13 14 15 |
# File 'lib/new_relic/agent/pipe_service.rb', line 13 def connect(config) nil end |
#error_data(errors) ⇒ Object
30 31 32 |
# File 'lib/new_relic/agent/pipe_service.rb', line 30 def error_data(errors) write_to_pipe(:error_traces => errors) if errors end |
#get_agent_commands ⇒ Object
17 18 19 |
# File 'lib/new_relic/agent/pipe_service.rb', line 17 def get_agent_commands [] end |
#metric_data(last_harvest_time, now, unsent_timeslice_data) ⇒ Object
21 22 23 24 |
# File 'lib/new_relic/agent/pipe_service.rb', line 21 def metric_data(last_harvest_time, now, unsent_timeslice_data) write_to_pipe(:stats => hash_from_metric_data(unsent_timeslice_data)) {} end |
#shutdown(time) ⇒ Object
38 39 40 41 |
# File 'lib/new_relic/agent/pipe_service.rb', line 38 def shutdown(time) write_to_pipe('EOF') NewRelic::Agent::PipeChannelManager.channels[@channel_id].close end |
#sql_trace_data(sql) ⇒ Object
34 35 36 |
# File 'lib/new_relic/agent/pipe_service.rb', line 34 def sql_trace_data(sql) write_to_pipe(:sql_traces => sql) if sql end |
#transaction_sample_data(transactions) ⇒ Object
26 27 28 |
# File 'lib/new_relic/agent/pipe_service.rb', line 26 def transaction_sample_data(transactions) write_to_pipe(:transaction_traces => transactions) if transactions end |