Java client stats question

Guido Medina guido.medina at temetra.com
Thu Jul 25 06:25:03 EDT 2013


Hi,

Is there a way to get the JSON stats via PBC? This is how we are doing 
it now, we would like to get rid of any HTTP call, currently, this is 
the only call being made to HTTP:

/private void collectNodeInfo(final PBClientConfig clientConfig)//
//  {//
//    ...//
//    RiakClusterStats stats=null;//
//    try{//
//      stats=new RiakClusterStats();//
//      HttpClient client=new DefaultHttpClient();//
////*HttpGet g=new HttpGet("http://" + clientConfig.getHost() + 
":8098/stats");*//
//      HttpResponse resonse=client.execute(g);//
//      JSONObject statsMap;//
//      InputStream contentStream=null;//
//      try{//
//        contentStream=resonse.getEntity().getContent();//
//        JSONTokener tok=new JSONTokener(contentStream);//
//        statsMap=new JSONObject(tok);//
//        stats.addNode(clientConfig.getHost(),statsMap);//
//      } finally{//
//        if(contentStream != null){//
//          contentStream.close();//
//        }//
//      }//
//    } catch(Exception e){//
//      log.error("Huh? Exception when ",e);//
//    }//
//    lastClusterStats=stats;//
//  }/


Kind regards,

Guido.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20130725/42802fe7/attachment.html>


More information about the riak-users mailing list