tim-group / java-statsd-client

a java statsd client library
Other
275 stars 139 forks source link

execution times > 24 days #11

Closed g76r closed 10 years ago

g76r commented 10 years ago

For some purpose of mine I need to record exec times > 2^31 (they are not actual exec times but workflow length time). Would it be okay to replace int with long ? May I do it myself and file in a pull request ? I think this API change would keep source-level backward compatibility since promoting int to long is supported transparently by Java. Thanks in advance.

jonbartels commented 10 years ago

You might be interested in my pull request - https://github.com/youdevise/java-statsd-client/pull/13

I do not think this does what you want though. You actually need to record that you had a runtime > MAX_INT rather than simply setting it as a ceiling.

For your actual need would it be better for you to report the stat to statsd using a different unit? IIRC the timers default to milliseconds. You might be better off reporting your runtime in days or weeks instead of in billions of milliseconds.

JensRantil commented 10 years ago

:+1: for this issue. It needs to be fixed. As of @jonbartels's pull request (#13) I don't think anything should be rounded down to ceiling.

scarytom commented 10 years ago

apologies for leaving this unfixed for so long. I've just pushed a fix, and hope to release a new version later today or early next week.

g76r commented 9 years ago

Thx