Java API Stopwatch

Is there anything that would allow me to create a static object in my class or extend my class and give me the opportunity to start, stop the time, set up statistics collection using the properties file, and a bunch of other useful properties that I don’t even know about.

I am working on an application that has a crazy amount of threads running at any given time, and it makes it increasingly difficult to make sense from the log files. That is why I am looking for some solution that will help me with this.

Ideally, I would like to have a bean in my spring application context, which would pretty much automate all annotation-based tread run tracking, which would allow me to tune the stream names and stopwatch accuracy. It is also more convenient to connect it to the database, and not just to the log file.

+4
source share
3 answers

Maybe you need apache public StopWatch class

+6
source

Since you already use Spring, you can use Spring StopWatch , although it does not meet your additional goals: able to save data. Please note that it is not intended for use in production, but only for additional information during development and testing.

+4
source

I'm not quite sure that I understand what you are trying to achieve.

Do you want to save statistics for a certain time line and export it to the data source using some plug-in API?

Perhaps you should take a look at the Stats of commons Twitter package, they just opened it not so long ago, so the documentation and examples are still not enough, you will need to understand it mostly on your own, but I think this is what you need.

+3
source

All Articles