lib/ting_yun/instrumentation/thrift.rb in tingyun_rpm-1.6.1 vs lib/ting_yun/instrumentation/thrift.rb in tingyun_rpm-3.2.0

- old
+ new

@@ -4,11 +4,11 @@ TingYun::Support::LibraryDetection.defer do named :thrift depends_on do - defined?(::Thrift) && defined?(::Thrift::Client) && defined?(::Thrift::BaseProtocol) + defined?(::Thrift) && defined?(::Thrift::Client) && defined?(::Thrift::BaseProtocol) && false end executes do TingYun::Agent.logger.info 'Installing Thrift Instrumentation' @@ -49,11 +49,11 @@ return send_message_args_without_tingyun(args_class, args) unless TingYun::Agent.config[:'nbs.transaction_tracer.thrift'] && TingYun::Agent.config[:'nbs.transaction_tracer.enabled'] begin state = TingYun::Agent::TransactionState.tl_get return unless state.execution_traced? - data = TingYun::Support::Serialize::JSONWrapper.dump("TingyunID" => create_tingyun_id("thrift")) + data = TingYun::Support::Serialize::JSONWrapper.dump("TingyunID" => create_tingyun_id("Thrift","thrift")) TingYun::Agent.logger.info("thift will send TingyunID : ", data) @oprot.write_field_begin("TingyunField", 11, 40000) @oprot.write_string(data) @oprot.write_field_end rescue => e @@ -94,11 +94,11 @@ tag = "#{args_class.to_s.split('::').first}.#{name}".downcase op_started = Time.now.to_f base, *other_metrics = metrics(tag) result = send_oneway_message_without_tingyun(name, args_class, args) duration = (Time.now.to_f - op_started)*1000 - TingYun::Agent.instance.stats_engine.tl_record_scoped_and_unscoped_metrics(base, other_metrics, duration) + # TingYun::Agent.instance.stats_engine.tl_record_scoped_and_unscoped_metrics(base, other_metrics, duration) result rescue => e TingYun::Agent.logger.debug("Failed to thrift send_oneway_message_with_tingyun : ", e) return send_oneway_message_without_tingyun(name, args_class, args) end @@ -126,17 +126,17 @@ node_name, *other_metrics = metrics(operate) duration = TingYun::Helper.time_to_millis(t1 - t0) my_data = state.thrift_return_data || {} # net_block_duration = my_data["time"]? duration - my_data["time"]["duration"]- my_data["time"]["qu"] : duration # net_block_duration = duration if net_block_duration < 0 - TingYun::Agent.instance.stats_engine.tl_record_scoped_and_unscoped_metrics( - node_name, other_metrics, duration - ) + # TingYun::Agent.instance.stats_engine.tl_record_scoped_and_unscoped_metrics( + # node_name, other_metrics, duration + # ) if my_data["time"] metrics_cross_app = metrics_for_cross_app(operate, my_data) _duration = my_data["time"]["duration"] + my_data["time"]["qu"] + 0.1 - ::TingYun::Agent.instance.stats_engine.record_scoped_and_unscoped_metrics(state, metrics_cross_app.pop, metrics_cross_app, duration, _duration) + # ::TingYun::Agent.instance.stats_engine.record_scoped_and_unscoped_metrics(state, metrics_cross_app.pop, metrics_cross_app, duration, _duration) end if node node.name = node_name ::TingYun::Agent::Collector::TransactionSampler.add_node_info(:uri => "thrift:#{tingyun_host}:#{tingyun_port}/#{operate}") stack = state.traced_method_stack \ No newline at end of file