lib/ting_yun/instrumentation/thrift.rb in tingyun_rpm-1.1.0 vs lib/ting_yun/instrumentation/thrift.rb in tingyun_rpm-1.1.1

- old
+ new

@@ -22,11 +22,11 @@ @operations ||= {} end def started_time_and_node(operate) _op_ = operations.delete(operate) - time = (_op_ && _op_[:started_time]) or Time.now.to_f + time = (_op_ && _op_[:started_time]) || Time.now.to_f node = _op_ && _op_[:node] [time, node] end @@ -259,11 +259,11 @@ alias :send_message_args :send_message_args_with_tingyun def send_message_with_tingyun(name, args_class, args = {}) - tag = "#{args_class.to_s.split('::').first.downcase}.#{name}" + tag = "#{args_class.to_s.split('::').first}.#{name}".downcase t0 = Time.now.to_f operations[tag] = {:started_time => t0} state = TingYun::Agent::TransactionState.tl_get return unless state.execution_traced? stack = state.traced_method_stack @@ -275,10 +275,10 @@ alias :send_message_without_tingyun :send_message alias :send_message :send_message_with_tingyun def send_oneway_message_with_tingyun(name, args_class, args = {}) - tag = "#{args_class.to_s.split('::').first.downcase}.#{name}" + 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) \ No newline at end of file