Netflix/servo — pull request #160 by brharrington (2013-05-17 18:01:11+00:00)
Title: Issue 144

Fix for: https://github.com/Netflix/servo/issues/144

Note this change is not fully backwards compatible. Counter has been changed to be more generic and implement Monitor rather than Monitor. This allows for more options with Counter types that do local computation than just returning the value. In this case ResettableMonitor will return a double for getValue. From my initial test, we see the following behavior:

1. Code compiled for a previous version will work fine, but will get a ClassCastException if using something with the expectation that Counter.getValue returns Long. Example:

Counter c = ...
Long v = c.getValue(); // ClassCastException
Number v = c.getValue(); // Should still work

2. The code like above will be a compile error when they try to compile to a new version.

This is not ideal, but most users only use the increment functions with the reads only being done for publishing, so this will hopefully have minimal impact.