guava
guava copied to clipboard
Provide ServiceManager.stopTimes() to enable debugging slow ServiceManager shutdowns
Consider providing ServiceManager.stopTimes()
to enable debugging slow ServiceManager shutdowns.
There currently exists serviceManager.startupTimes()
for startup time, this would be the equivalent for the shutdown process.
@Kurru I have raised the pull request for the requested support. Please refer https://github.com/google/guava/pull/5873
Do you actually have a use case for this feature? What will you use it for? Or are you proposing it simply for completeness?
When I start my server I print out the time taken to start all services, which is easy given the current supported API. This lets me see which service was responsible for slow server start performance.
I want the same ability for server shutdown. Currently, when I stop my server, it waits for all services to stop running, however I have no easy visibility into the shutdown delay which is frustrating.
Slow shutdown services have occurred within my server on several occasions. When this happens, it is very hard to attribute this back to the appropriate service, as I don't know which service is still 'running'. This API would give me an easy retrospective view into 'oh service x took 23 seconds to stop, let me investigate how that could happen'.
Typically this has been due to a slow, blocking rpc call within a scheduled service, or a blocking retry within the run block.