Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8060843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:07:45+00:00 2026-06-05T10:07:45+00:00

We use scheduled tasks in a Spring web application to send reminders, daily digests,

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T10:07:47+00:00Added an answer on June 5, 2026 at 10:07 am

    You can use:

    • perf4j – provides some aspects and a lot of statistical tools

    • custom made aspectj aspect

    • use built-in Spring: Standard Logging aspect (interceptor) – it can measure execution time with $[invocationTime] placeholder

    In all of the solutions above you need to somehow distinguish which methods you want to track. You can take all methods of some interface, all methods annotated with some annotation (including custom one), use method naming convention…

    Of course you must choose a solution that best fits your needs as the ultimate goal is to have monitoring without adding any external code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working with JBoss 4 & Spring. In a web application, I use Quartz
I have an asp.net MVC web application that requires tasks to be scheduled. (A
I would like to use Powershell to create a couple of scheduled tasks, on
I have a simple console application which runs daily (called by windows task scheduler)
I wonder if there's a way to use scheduled tasks with SQL Azure? Every
I have a web application that uses Struts2 + Spring for the resource injection,
I have a web application based on the sharp-architecture framework. It actually use NHibernate
In a spring application I want do some background computing. The task is that
I use this command to run php file from plesk scheduled tasks: php -q
Is there some way to use schtasks to create a task with multiple schedules

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.