lib/ting_yun/agent/transaction.rb in tingyun_rpm-1.6.1 vs lib/ting_yun/agent/transaction.rb in tingyun_rpm-3.2.0

- old
+ new

@@ -23,13 +23,14 @@ SUBTRANSACTION_PREFIX = 'Nested/'.freeze - CONTROLLER_PREFIX = 'WebAction/'.freeze - BACKGROUND_PREFIX = 'BackgroundAction/'.freeze - RAKE_TRANSACTION_PREFIX = 'BackgroundAction/Rake'.freeze + CONTROLLER_PREFIX = 'Transaction/'.freeze + COSS_CONTROLLER_PREFIX = 'WebAction/'.freeze + BACKGROUND_PREFIX = 'TaskAction/'.freeze + RAKE_TRANSACTION_PREFIX = 'TaskAction/Rake'.freeze TASK_PREFIX = 'OtherTransaction/Background/'.freeze RACK_PREFIX = 'Rack/'.freeze SINATRA_PREFIX = 'WebAction/Sinatra/'.freeze MIDDLEWARE_PREFIX = 'Middleware/'.freeze GRAPE_PREFIX = 'WebAction/Grape/'.freeze @@ -65,11 +66,10 @@ def initialize(category, client_transaction_id, options) @start_time = Time.now.to_f - @exceptions = TingYun::Agent::Transaction::Exceptions.new @metrics = TingYun::Agent::TransactionMetrics.new @attributes = TingYun::Agent::Transaction::Attributes.new @apdex = TingYun::Agent::Transaction::Apdex.new(options[:apdex_start_time], @start_time) @@ -83,10 +83,11 @@ @base_quantile_hash = {} @default_name = TingYun::Helper.correctly_encoded(options[:transaction_name]) if request = options[:request] @request_attributes = TingYun::Agent::Transaction::RequestAttributes.new request + @attributes.merge_request_header(@request_attributes.header.select{|k,v|k.start_with?("HTTP")}) else @request_attributes = nil end end @@ -116,11 +117,10 @@ def stop(state, end_time, outermost_frame, summary_metrics = []) - freeze_name_and_execute if @has_children or @is_mq name = Transaction.nested_transaction_name(outermost_frame.name) trace_options = TRACE_OPTIONS_SCOPED @@ -147,11 +147,11 @@ commit(state, end_time, name) end - def commit(state, end_time, outermost_node_name) + def commitV2(state, end_time, outermost_node_name) assign_agent_attributes(state) TingYun::Agent.instance.transaction_sampler.on_finishing_transaction(state, self, end_time,@exceptions) @@ -163,9 +163,27 @@ @exceptions.record_exceptions(@attributes) TingYun::Agent.instance.stats_engine.merge_transaction_metrics!(@metrics, best_name) TingYun::Agent.instance.stats_engine.record_base_quantile(@base_quantile_hash) unless @exceptions.had_error? + end + + def commit(state, end_time, outermost_node_name) + + assign_agent_attributes(state) + + + TingYun::Agent.instance.transaction_sampler.on_finishing_transaction(state, self, end_time,@exceptions) + + TingYun::Agent.instance.sql_sampler.on_finishing_transaction(state, @frozen_name) + # + # record_summary_metrics(state, outermost_node_name, end_time) unless @exceptions.had_error? + # @apdex.record_apdex(@frozen_name, end_time, @exceptions.had_error?) + # @exceptions.record_exceptions(@attributes) + # + # + # TingYun::Agent.instance.stats_engine.merge_transaction_metrics!(@metrics, best_name) + # TingYun::Agent.instance.stats_engine.record_base_quantile(@base_quantile_hash) unless @exceptions.had_error? end end end end