RJMetrics/RJMetrics-ruby — pull request #3 by owengalenjones (2014-04-03 14:10:16+00:00)
Title: Push in batches

## Batch Imports

`Client#pushData` now will send data points to the IAPI in batches of 100.

## Functional Tests

* Set the `API_BASE` and `SANDBOX_BASE` to my vm
* Ran the following:

```ruby
irb(main):001:0> require 'rjmetrics_client'
=> true
irb(main):002:0> c = RJMetricsClient.new(2,'3d1f18ca548fb694b11ae4c309060f5d')
pushing batch of 1 data points
=> #>
irb(main):004:0> require "./test/client_spec"
=> true
irb(main):014:0> importdata = (ImportData.new(1)..ImportData.new(200)).to_a
=> [{:keys=>[:id], :id=>1}, {:keys=>[:id], :id=>2}, {:keys=>[:id], :id=>3}, ..., :id=>200}]
irb(main):016:0> c.pushData("batchtest", importdata)
pushing batch of 100 data points
pushing batch of 100 data points
=> ["{\"code\":201,\"message\":\"Created\"}", "{\"code\":201,\"message\":\"Created\"}"]
```

Then in Mongo:

```
> db.batchtest.count()
200
> db.batchtest.findOne()
{
"_id" : ObjectId("533d69c1e0ab7559d85b2dc0"),
"keys" : [
"id"
],
"id" : 1,
"_updated_at" : "2014-04-03T14:01:37.032Z"
}
```