Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
StopWatch should aggregate tasks [SPR-1962] #6655
It was annoying me that StopWatch didn't allow me to aggregate tasks with the same name -- that is, if I run two tasks with the same name I should be able to easily get the total time spent on <taskname>, including a pretty printout. I've hastily put together an implementation of how I think it might work (which I'm using) which I thought I might share.
Rossen Stoyanchev commented
This issue has been resolved through a selective bulk update, as part of a larger effort to better manage unresolved issues. To qualify for the update, the issue was either created before Spring 3.0 or affects a version older than Spring 3.0 and is not a bug.
There is a good chance the request was made obsolete, or at least partly outdated, by changes in later versions of Spring including deprecations. It is also possible it didn't get enough traction or we didn't have enough time to address it. One way or another, we didn't get to it.
If you believe the issue, or some aspects of it, are still relevant and worth pursuing at present you may re-open this issue or create a new one with a more up-to-date description.
We thank you for your contributions and encourage you to become familiar with the current process of managing Spring Framework JIRA issues that has been in use for over a year.
Add configuration option for the StopWatch to aggregate results of timers with the same name, as opposed to replacing them. To preserve existing behaviour, this functionality is disabled (set to false) by default. Changed the internals of the taskList to use a LinkedHashMap instead of a LinkedList so as to enable fast lookups of previous timers whilst also preserving the previous behaviour of ordering the list by insertion order. Closes spring-projectsgh-6655