Github の Rails リポジトリを参照して transaction_id の定義を見つけましたが、うまくいきません。
どんな取引ですか?イベントのグループに同じ transaction_id が使用されているようです。
ActiveSupport::Notifications.subscribe do |name, start, finish, transaction_id , payload|
Rails.logger.debug(["notification:", name, start, finish, transaction_id , payload].join(" "))
end
結果:
Started GET "/" for 127.0.0.1 at 2012-10-16 15:51:40 +0200
notification: sql.active_record 2012-10-16 15:51:40 +0200 2012-10-16 15:51:40 +0200 9eb707034598e4cc7c32 {:sql=>"SHOW client_min_messages", :name=>"SCHEMA", :connection_id=>46235640, :binds=>[]}
notification: sql.active_record 2012-10-16 15:51:40 +0200 2012-10-16 15:51:40 +0200 9eb707034598e4cc7c32 {:sql=>"SET client_min_messages TO 'panic'", :name=>"SCHEMA", :connection_id=>46235640, :binds=>[]}
notification: sql.active_record 2012-10-16 15:51:40 +0200 2012-10-16 15:51:40 +0200 9eb707034598e4cc7c32 {:sql=>"SET standard_conforming_strings = on", :name=>"SCHEMA", :connection_id=>46235640, :binds=>[]}
notification: sql.active_record 2012-10-16 15:51:40 +0200 2012-10-16 15:51:40 +0200 9eb707034598e4cc7c32 {:sql=>"SET client_min_messages TO 'notice'", :name=>"SCHEMA", :connection_id=>46235640, :binds=>[]}
notification: sql.active_record 2012-10-16 15:51:40 +0200 2012-10-16 15:51:40 +0200 9eb707034598e4cc7c32 {:sql=>"SET time zone 'UTC'", :name=>"SCHEMA", :connection_id=>46235640, :binds=>[]}
...
notification: process_action.action_controller 2012-10-16 15:51:40 +0200 2012-10-16 15:51:41 +0200 9eb707034598e4cc7c32 {:controller=>"PagesController", :action=>"index", :params=>{"controller"=>"pages", "action"=>"index"}, :format=>:html, :method=>"GET", :path=>"/", :status=>200, :view_runtime=>339.344333, :db_runtime=>31.421587}
同じ transaction_id: 9eb707034598e4cc7c32