BUG-1813: fix DurationStatsTracker performance 61/11061/6
authorRobert Varga <rovarga@cisco.com>
Thu, 11 Sep 2014 14:25:58 +0000 (16:25 +0200)
committerRobert Varga <rovarga@cisco.com>
Sat, 13 Sep 2014 13:33:14 +0000 (15:33 +0200)
commit1a4c03a2a3d9aea1605fa7de5a27b6aea6d2f1fe
treef9d669796bfd30f6e357b834c96017341266f16a
parent9958ea3f323d621c57763d4912ca91b1288742c4
BUG-1813: fix DurationStatsTracker performance

This fixes the performance issues without affecting the behaviour in the
contended case. This lowers the overhead by moving to an LongAdder,
splitting out the duration/timestamp structure and moving the division
into the read path.

A follow-up patch will rework the code organization to allow for two
different implementations, where this one is useful for highly-contented
deployments. The other implementation will use synchronized block and be
useful for things which are not likely to be contended.

Change-Id: Ic8a1d5df9d1d64460670723bac7e644733237ef7
Signed-off-by: Robert Varga <rovarga@cisco.com>
common/util/src/main/java/org/opendaylight/yangtools/util/DurationStatsTracker.java
common/util/src/main/java/org/opendaylight/yangtools/util/DurationWithTime.java [new file with mode: 0644]