diff options
author | George Claghorn <george@basecamp.com> | 2018-01-10 21:46:55 -0500 |
---|---|---|
committer | George Claghorn <george@basecamp.com> | 2018-01-10 21:48:53 -0500 |
commit | c69c7b3690537fa7210f901b1f35f787d0d5338b (patch) | |
tree | 52d3ff44c07f2595ceb082416c163c1fd7efb428 | |
parent | 2a934aa3c9e82d43e4e984ad22717f957b4066da (diff) | |
download | rails-c69c7b3690537fa7210f901b1f35f787d0d5338b.tar.gz rails-c69c7b3690537fa7210f901b1f35f787d0d5338b.tar.bz2 rails-c69c7b3690537fa7210f901b1f35f787d0d5338b.zip |
Instrument preview image drawing
-rw-r--r-- | activestorage/lib/active_storage/previewer.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/activestorage/lib/active_storage/previewer.rb b/activestorage/lib/active_storage/previewer.rb index 7db9ae5956..dacab1e7df 100644 --- a/activestorage/lib/active_storage/previewer.rb +++ b/activestorage/lib/active_storage/previewer.rb @@ -43,9 +43,11 @@ module ActiveStorage # # The output tempfile is opened in the directory returned by ActiveStorage::Downloading#tempdir. def draw(*argv) #:doc: - Tempfile.open("ActiveStorage", tempdir) do |file| - capture(*argv, to: file) - yield file + ActiveSupport::Notifications.instrument("preview.active_storage") do + Tempfile.open("ActiveStorage", tempdir) do |file| + capture(*argv, to: file) + yield file + end end end |