Nonblocking StatHat Ruby Gem Released

We changed the stathat Ruby gem to improve the performance. It uses a queue of data points and a pool of threads servicing the queue. Your calls to send data to StatHat will no longer wait for the HTTP request to finish.


gem update stathat

to get the latest version.

The API function calls did not change, but they no longer return the response. If you’d like to examine the response, you can use a block:

StatHat::API.ez_post_value("request time", "", 12.3) do |r|
    unless r.valid?
        puts "Error sending data to StatHat.  Status #{r.status}, Message: #{r.msg}."

Let us know if we can do anything to help you use this gem in your applications.

Comments? Send us a tweet.


Automatically Run Go Tests When Files Change (OS X)
Campfire Integration