metrics
metrics copied to clipboard
Add JVM shutdown hook to report the metrics from the current TimeWindow.
Currently all the TimeWindow based reporter has to wait for the next time window to report the metrics. To make it work from a batch job or from a Lambda function, client will have to sleep for at least the reporting frequency (60 seconds by default) at the end of the job.
Instead we need to add a JVM shutdown hook that would flush and report the metrics from the current time window.
I would suggest - as a solution - that the existing "com.yahoo.yamas.YamasReporter#close()" would flush the report before returning...