Closed jamesarosen closed 11 years ago
sample_rate
parameter and send only a portion of the requests to reduce HTTP traffic.I'm also happy to add a reference client implementation. I'd like to keep it as framework-agnostic as possible, but I also don't want to reimplement $.ajax
and _.debounce
. Perhaps something like
var $ = window.$ || {},
_ = window._ || {},
ajax = $.ajax || function() { throw "Please define StatsdClient.ajax"; },
debounce = $.debounce || _.debounce || function() { throw "Please define StatsdClient.debounce"; };
function StatsdClient() {
// ...
}
StatsdClient.ajax = ajax;
StatsdClient.debounce = debounce;
I think this would be better as a separate gem is it isn't core functionality and it's easy to make it a separate gem.
OK. I'll work on that.
@jamesarosen Let me know when it's available and I'll link it up in the README! Thanks!
This endpoint makes it easy for sites to collect client-side stats. It exposes (most of) the functionality of the existing
Statsd
client object as a Rack endpoint.It is not automatically required when loading the library, nor did I add Rack as a runtime dependency. (I would have added it as an optional dependency if Rubygems supported that concept.)