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

API Improvements #1

Merged
merged 1 commit into from
Jan 12, 2013
Merged

API Improvements #1

merged 1 commit into from
Jan 12, 2013

Conversation

ashofthedream
Copy link

Cause for replacing String[] to String...

// More readable, simplify. With backwards compatibility
statsd.count("mycount", 24, new String[]{"foo:bar","baz"});
statsd.count("mycount", 24, "foo:bar","baz");

Cause for replacing int to long in time():

// Timestamp in java is always long. Use old api we must cast to int:
long started = System.currentTimeMillis(); // or System.nanoTime(), or Data#getTime();
foo();
long end = System.currentTimeMillis() - started;
statsd.time("requests.show_tables", (int) end);

// Now we pass timeout without casting: 
statsd.time("requests.show_tables", end);

// And backwards compatibility: casting without lose precision
int timeout = 10
statsd.time("requests.show_tables", timeout);

…y vararg String: 'String... tags'.

Removed unnecessary methods without vararg tags argument.
Changed signature of 'time' and 'recordExecutionTime' methods: timeInMs now is long.
Removed explicit array creation in test case.
charles-dyfis-net added a commit that referenced this pull request Jan 12, 2013
@charles-dyfis-net charles-dyfis-net merged commit 22f8883 into indeedeng:master Jan 12, 2013
@charles-dyfis-net
Copy link

Thank you for the contribution; this has been merged into the 2.0.6 release.

indeedeng-release pushed a commit that referenced this pull request Mar 22, 2016
Externalise DNS resolution on the NonBlockingStatsDClient.
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.

2 participants