We use scheduled tasks in a Spring web application to send reminders, daily digests, etc.:
<task:scheduled-tasks>
<task:scheduled ref="fooService" method="bar" cron="0 0/5 * * * ?"/>
</task:scheduled-tasks>
Each scheduled task invokes a given service method (fooService.bar() in the pseudocode above). I'd like to monitor how long each execution lasts. Some of these methods might take longer as load, data, or complexity increases. I can add logging statements to each service method (~10 now, but probably more in the future), or use aspects to put some stopwatch behavior around each method. But is there a more direct way to achieve this for all scheduled-tasks in spring?