Module: TingYun::Instrumentation::Support::ExternalHelper
- Defined in:
- lib/ting_yun/instrumentation/support/external_helper.rb
Instance Method Summary collapse
- #create_tingyun_id(protocol) ⇒ Object
-
#tingyun_externel_guid ⇒ Object
generate a random 64 bit uuid.
Instance Method Details
#create_tingyun_id(protocol) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/ting_yun/instrumentation/support/external_helper.rb', line 8 def create_tingyun_id(protocol) state = TingYun::Agent::TransactionState.tl_get externel_guid = tingyun_externel_guid state.extenel_req_id = externel_guid cross_app_id = TingYun::Agent.config[:tingyunIdSecret] or raise TingYun::Agent::CrossAppTracing::Error, "no tingyunIdSecret configured" state.add_current_node_params(:txId=>state.request_guid, :externalId=>state.extenel_req_id) "#{cross_app_id};c=1;x=#{state.request_guid};e=#{externel_guid};s=#{TingYun::Helper.time_to_millis(Time.now)};p=#{protocol}" end |
#tingyun_externel_guid ⇒ Object
generate a random 64 bit uuid
19 20 21 22 23 24 25 |
# File 'lib/ting_yun/instrumentation/support/external_helper.rb', line 19 def tingyun_externel_guid guid = '' 16.times do guid << (0..15).map{|i| i.to_s(16)}[rand(16)] end guid end |