0.0
No commit activity in last 3 years
No release in over 3 years
Square Cube evaluator gem
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
 Project Readme

Cube Evaluator Build Status

Obtain data from cube evaluators in a nice format

Installation

Add this to your Gemfile

gem 'cube-evaluator'

and then run

$ bundle

Usage

Configure the cube evaluator client

# use default hostname and port of localhost:1081
$cube_evaluator = Cube::Evaluator.new

# use custom hostname and port
$cube_evaluator = Cube::Evaluator.new 'cube.example.com', 2280

Ask for some metrics

$cube_evaluator.metric(
  :expression => 'sum(request)',
  :start => Time.now - 2592000,
  :stop => Time.now,
  :limit => 10,
  :step => '1minute'
)

The result will be a json encoded Hash with an array of 'times' and the corresponding 'values' like

{ 
  "times" => [
    "2012-07-16T11:40:00.000Z",
    "2012-07-16T11:41:00.000Z",
    "2012-07-16T11:42:00.000Z",
    "2012-07-16T11:43:00.000Z",
    "2012-07-16T11:44:00.000Z",
    "2012-07-16T11:45:00.000Z",
    "2012-07-16T11:46:00.000Z"
  ],
  "values" => [1, 2, 3, 4, 5, 6, 7]}
}

The supported steps are:

  • 10seconds
  • 1minute
  • 5minutes
  • 1hour
  • 1day

For a complete guide on how to use the cube evaluator take a loot at:

https://github.com/square/cube/wiki/Evaluator

TODO

  • Add support for evaluator events and types