You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 2, 2019. It is now read-only.
MIT licensed. See the LICENSE file for more details.
for more details.
Installation
Since Cube is under constant development, it's best if you specify a particular
version of cube-ruby in your Gemfile. That way, you can ensure your Ruby
application and your Cube instance will be compatible with each other.
gem 'cube-ruby', require: "cube"
# or specify a particular version:
gem 'cube-ruby', '0.0.2', require: "cube"
And then execute:
$ bundle
Or install it yourself as:
$ gem install cube-ruby
Usage
Set up a global Cube client
# use default hostname and port of localhost:1180
$cube =Cube::Client.new# use custom hostname and port
$cube =Cube::Client.new'cube.example.org',2280
Send Cube some metrics!
# send a new "foo" event to cube
$cube.send"foo"# send a new event to cube that looks like this:# { type: "request", data: { value: "somevalue" } }
$cube.send"request",value: "somevalue"# optionally specify a specific date/time (two days ago)
$cube.send"request",DateTime.now - 2,value: "othervalue"# specify an event id (https://github.com/square/cube/wiki/Events)event_id=42
$cube.send"request",DateTime.now,event_id,duration_ms: 234
Yes, the method is called send. You can still call Object#send on
Cube::Client objects by using the __send__ method, per the Ruby docs.
Testing
Run the specs with rake.
To include real UDP socket testing in the specs, run LIVE=true rake.
Contributing
Fork it
Create your feature branch (git checkout -b my-new-feature)
Commit your changes (git commit -am 'Added some feature')
Push to the branch (git push origin my-new-feature)