make ThreadsWatcher log at fixed intervals, not continuously
authorMichael Vorburger <vorburger@redhat.com>
Wed, 28 Feb 2018 11:28:50 +0000 (12:28 +0100)
committerAnil Belur <abelur@linuxfoundation.org>
Thu, 7 Oct 2021 05:19:57 +0000 (15:19 +1000)
commitbdf3cc893f8ecbbeae7a5ee2a314634d5cbd2899
tree966854da194ea427c7d662e187b59cca30136483
parent2fb7f17fdca49dfdf5b37c8db8044c760ee57808
make ThreadsWatcher log at fixed intervals, not continuously

yet let it still check at shorter intervals than it will log

because it's been observed that when we hit max threads or deadlock,
then as it is, it will log continuously like crazy, at the speed of the
intervals it checks (defaults to 500ms).  Increasing that interval to a
much larger value (say 1min) is a shame because that could then take a
longer time to find issues, or even miss them.  So that this does it can
keep checking frequently, but doesn't have to report and spew logs as
often.

The new max log intervals are hard-coded to 1min in this first change.

see https://lists.opendaylight.org/pipermail/infrautils-dev/2018-February/000596.html

Change-Id: I075d9789af7c091e67b75c390963e71351f60672
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
metrics/impl/src/main/java/org/opendaylight/infrautils/metrics/internal/ThreadsWatcher.java
metrics/impl/src/test/java/org/opendaylight/infrautils/metrics/internal/ThreadsWatcherTest.java