Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timer sum double #442

Merged
merged 7 commits into from Mar 4, 2015
Merged

Timer sum double #442

merged 7 commits into from Mar 4, 2015

Conversation

GeorgeJahad
Copy link
Contributor

This is the continuation of:
#440

Chinmay asked for some changes, and Tilo asked me to do them while she is at Rax.io for the week.

The only part of this PR that still needs to be reviewed is this:
24ecd6e

tilogaat and others added 6 commits February 19, 2015 14:03
1. serializeV1 is only for testing and writes sum as long
2. Tests prove that written in any format, the serializer is able to deserialize them.
methods to take timerVersion parameter to reduce
code duplication
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.05%) to 52.79% when pulling 24ecd6e on timer-sum-double into 7937a0b on master.

@@ -535,7 +556,7 @@ private static AbstractRollupStat getStatFromRollup(byte statType, BasicRollup b
public ByteBuffer toByteBuffer(Object o) {
try {
byte type = typeOf(o);
byte[] buf = new byte[sizeOf(o, type)];
byte[] buf = new byte[sizeOf(o, type, VERSION_2_TIMER)];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems a bit strange to pass in the timer version while serializing non-timer rollups like gauges, counters etc. What do you think about having two overloaded methods named sizeOf with one accepting just two arguments i.e (Object, Type) which will be used by all non-timer rollup types and then the other one with timerVersion as the third argument, which gets called by the timer serializer?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is much cleaner. I originally thought there was a problem doing it this way, but it seems much better. I'll push some changes shortly.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.03%) to 52.81% when pulling be58173 on timer-sum-double into 7937a0b on master.

@chinmay-gupte
Copy link
Contributor

+1

GeorgeJahad added a commit that referenced this pull request Mar 4, 2015
@GeorgeJahad GeorgeJahad merged commit f6daf3d into master Mar 4, 2015
@GeorgeJahad GeorgeJahad deleted the timer-sum-double branch March 4, 2015 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants