Java client stats question

Guido Medina guido.medina at temetra.com
Thu Jul 25 11:31:18 EDT 2013


Hi Brian,

We have a custom (and very small) admin page that shows Riak KV version, 
connected nodes and ring members, here is how it looks:

riak_kv_version 	1.4.0
connected_nodes 	riak at node2
riak at node3
riak at node4
riak at node5
ring_members 	riak at node1
riak at node2
riak at node3
riak at node4
riak at node5
sys_system_architecture 	x86_64-unknown-linux-gnu


That also tell us where the running app is working against, if dev or 
prod cluster cause nodes will be different. We also show some buckets 
information but that is currently on PBC.

Guido.


On 25/07/13 16:18, Brian Roach wrote:
> Guido -
>
> Right now, no.
>
> We've been having some internal discussions around that topic and
> whether it's really a "client library" operation or not.
>
> How are you using stats? Is it for a monitoring app or ... ?
>
> Thanks,
> Brian Roach
>
> On Thu, Jul 25, 2013 at 4:25 AM, Guido Medina <guido.medina at temetra.com> wrote:
>> 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.
>>
>> _______________________________________________
>> riak-users mailing list
>> riak-users at lists.basho.com
>> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>>

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


More information about the riak-users mailing list