2018/07/27分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
- Add cpu_time, idle_time, and allocations to Event
- Add "event object" support to the notification system.
Add cpu_time, idle_time, and allocations to Event
activesupport/lib/active_support/notifications/instrumenter.rb
、
activesupport/lib/active_support/subscriber.rb
の修正です。
ActiveSupport::Notifications::Event
が保持するデータに、cpu time, idle time, 及びオブジェクトの数を追加しています。
オブジェクトの数はGC.stat
の:total_allocated_objects
を使用しています。GC.stat
の結果に:total_allocated_objects
が無いJRubyでは0を返すようになっています。
Merge pull request #33451 from rails/event-object-subscription
activesupport/lib/active_support/notifications/fanout.rb
、
activesupport/lib/active_support/notifications/instrumenter.rb
の修正です。
ActiveSupport::Notifications.subscribe
のブロックに指定したパラメータが一つだけだった場合、ActiveSupport::Notifications::Event
のインスタンスをブロックに渡すよう修正しています。
元々、ActiveSupport::Notifications.subscribe
のブロックに渡されるパラメータはeventに関する各種情報(eventの名前、開始時刻、終了時刻、payload等)で、ActiveSupport::Notifications::Event
のインスタンスが必要な場合、それらのパラメータを使って、明示的にオブジェクトの生成処理を行う必要がありました。
この対応により、ActiveSupport::Notifications::Event
のインスタンスが必要な場合、ActiveSupport::Notifications.subscribe
のブロックから直接受け取れるようになっています。
# before ActiveSupport::Notifications.subscribe('wait') do |*args| @event = ActiveSupport::Notifications::Event.new(*args) end ActiveSupport::Notifications.instrument('wait') do sleep 1 end @event.duration # => 1000.138
# after ActiveSupport::Notifications.subscribe('wait') do |event| @event = event end ActiveSupport::Notifications.instrument('wait') do sleep 1 end @event.duration # => 1000.138
activesupport/CHANGELOG.md
の修正です。
artisanal
をarsenal
にタイポしていたのを修正しています。
activestorage/lib/active_storage/log_subscriber.rb
の修正です。
service_download
のaliasとして、service_streaming_download
を定義して、streaming downloads実行時にログが出力されるようにしています。
Merge pull request #33441 from bogdanvlviv/remove-rubocop-comments-from-codebase
テストコード内で個別にrubocop:disable Performance/RedundantMerge
を指定していたのを、そもそもテストについてはPerformance
copの対象としないよう修正しています。
PostgreSQL 10 new relkind for partitioned tables (#31336)
PostgreSQLのpartitioned tablesについてのサポートを追加しています。
これにより、partitioned tablesで定義されたtableも、普通のtableやviewと同様にActive Recordから操作出来るようになっています。
Fix directly uploading zero-byte files
activestorage/app/assets/javascripts/activestorage.js
、
activestorage/app/javascript/activestorage/file_checksum.js
の修正です。
Active Storageのdirecty uploadで0バイトのファイルがアップロード出来ないバグがあったのを修正しています。
activestorage/app/javascript/activestorage/file_checksum.js
の修正です。
chunkをreadする必要かあるかどうかの条件文に、中括弧を追加し条件がわかりやすくなるよう修正しています。
Merge pull request #33434 from utilum/remove_testing_guide_comment
rails guideのTesting Rails Applications
の修正です。
Rails meets Minitest
の項にあるテストメソッド名についての説明から、不要なコメントを削除しています。