1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Instrument preview image drawing

This commit is contained in:
George Claghorn 2018-01-10 21:46:55 -05:00
parent 2a934aa3c9
commit c69c7b3690

View file

@ -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