dropwizard/metrics — pull request #523 by omerkudat (2014-02-12 21:54:46+00:00)
Title: Add offset to Clock.UserTimeClock against overflow

UserTimeClock returns elapsed time from an arbitrary starting time, not
epoch. This means value could be negative or arbitrarily large (not in
line with System.currentTimeMillis.) Other metrics classes, such as
SlidingTimeWindowReservoir multiply the Clock.getTicks with some value
to create a collision buffer. If nanoTime is large enough, this can
overflow and break the window.

To work around this, this commit modifies Clock.UserTimeClock to return
elapsed time since the UserTimeClock class was classloaded. It is still
elapsed time and increasing, but it will be a smaller value and therefore
less likely to overflow. Unless the JVM has a really long uptime. Hmm...