Exemplo n.º 1
0
 /**
  * @return array associative array response
  * @param array $args array('time' => , 'type' => , 'data' => )
  */
 public function eventPut($args)
 {
     $args = \Cube\Command::prepPayload($args);
     $req = \Httpful\Request::post($this->collector_uri . '1.0/event/put')->sendsJson()->expectsJson()->body($args);
     $res = $req->send();
     if (array_key_exists('error', $res->body)) {
         // optionally log error? maybe throw exception?
         return false;
     }
     return true;
 }
Exemplo n.º 2
0
 public function testCommand()
 {
     $cmds = array('eventGet', 'metricGet', 'typesGet', 'eventPut');
     $this->assertEquals($cmds, \Cube\Command::getCommands());
 }