anteo / redmine_custom_workflows

Allows to create custom workflows for Redmine
http://www.redmine.org/plugins/custom-workflows
GNU General Public License v2.0
182 stars 72 forks source link

the time execute for group for custom workflows,need give time for each one #304

Closed ashrafalzyoud closed 1 year ago

ashrafalzyoud commented 1 year ago

I, [2023-02-27T23:10:06.446639 #14796]  INFO -- : [08c5dd97-d93e-4da4-804d-015cef3c2963] = Running before_save custom workflows for Issue (#12008) "(207-1)ashraf"
I, [2023-02-27T23:10:06.448139 #14796]  INFO -- : [08c5dd97-d93e-4da4-804d-015cef3c2963] == Running before_save custom workflow "ا"
I, [2023-02-27T23:10:06.535963 #14796]  INFO -- : [08c5dd97-d93e-4da4-804d-015cef3c2963] == Running before_save custom workflow "2"
I, [2023-02-27T23:10:06.536195 #14796]  INFO -- : [08c5dd97-d93e-4da4-804d-015cef3c2963] == Running before_save custom workflow "3"
I, [2023-02-27T23:10:06.536316 #14796]  INFO -- : [08c5dd97-d93e-4da4-804d-015cef3c2963] == Running before_save custom workflow "4"
I, [2023-02-27T23:10:06.536368 #14796]  INFO -- : [08c5dd97-d93e-4da4-804d-015cef3c2963] == Running before_save custom workflow "5"
I, [2023-02-27T23:10:06.536904 #14796]  INFO -- : [08c5dd97-d93e-4da4-804d-015cef3c2963] == Running before_save custom workflow "tag"
I, [2023-02-27T23:10:06.537683 #14796]  INFO -- : [08c5dd97-d93e-4da4-804d-015cef3c2963] == Running before_save custom workflow "555555555"
I, [2023-02-27T23:10:10.404682 #14796]  INFO -- : [08c5dd97-d93e-4da4-804d-015cef3c2963] == Running before_save custom workflow "9999999"
I, [2023-02-27T23:10:14.192162 #14796]  INFO -- : [08c5dd97-d93e-4da4-804d-015cef3c2963] = Finished running before_save custom workflows for Issue (#12008) "(207-1)ashraf"
I, [2023-02-27T23:10:14.199228 #14796]  INFO -- : [08c5dd97-d93e-4da4-804d-015cef3c2963] = Running after_save custom workflows for Issue (#12008) "(207-1)ashraf"
I, [2023-02-27T23:10:14.199837 #14796]  INFO -- : [08c5dd97-d93e-4da4-804d-015cef3c2963] == Running after_save custom workflow "1"
I, [2023-02-27T23:10:14.200193 #14796]  INFO -- : [08c5dd97-d93e-4da4-804d-015cef3c2963] == Running after_save custom workflow "2"
I, [2023-02-27T23:10:14.204435 #14796]  INFO -- : [08c5dd97-d93e-4da4-804d-015cef3c2963] = Finished running after_save custom workflows for Issue (#12008) "(207-1)ashraf"
I, [2023-02-27T23:10:14.209123 #14796]  INFO -- : [08c5dd97-d93e-4da4-804d-015cef3c2963] = Running after_save custom workflows for Issue (#18232) " #18232: eeeeeeeee"
I, [2023-02-27T23:10:14.210744 #14796]  INFO -- : [08c5dd97-d93e-4da4-804d-015cef3c2963] == Running after_save custom workflow "1"
I, [2023-02-27T23:10:14.211039 #14796]  INFO -- : [08c5dd97-d93e-4da4-804d-015cef3c2963] == Running after_save custom workflow "2"
I, [2023-02-27T23:10:14.214797 #14796]  INFO -- : [08c5dd97-d93e-4da4-804d-015cef3c2963] = Finished running after_save custom workflows for Issue (#18232) "دفعeee"
I, [2023-02-27T23:10:14.235322 #14796]  INFO -- : [08c5dd97-d93e-4da4-804d-015cef3c2963] Redirected to http://127.0.0.1:82/issues/18232?next_issue_id=17466
I, [2023-02-27T23:10:14.238282 #14796]  INFO -- : [08c5dd97-d93e-4da4-804d-015cef3c2963] Completed 302 Found in 8073ms (ActiveRecord: 398.7ms | Allocations: 3508291)

hi how i can know which one from custom workflow take long time?? why when execute the custom workflow given time for each one its difficult to know which one need update to good performance

picman commented 1 year ago

How about adding the following code into your workflows:

Rails.logger.info 'Workflow 1'
start = Time.now
# Your code
# ...
finish = Time.now
Rails.logger.info "Done in #{finish - start}s"