Hi,

According to your code:

> RegionServerMetrics metrics = new RegionServerMetrics();

I think that's why it is always empty.


I believe that the right way to get those stats is to use data exposed via
JMX by the RegionServer.
Alternatively you can poll RegionServer web ui periodically and parse html
to fetch data you want.

Alex Baranau
----
Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch - Hadoop - HBase

On Sat, Jan 7, 2012 at 10:51 AM, Christian Schäfer
<syrious3...@hotmail.de>wrote:

>
> Hello,
>
> I want to measure requests per second for each Region Server during
> inserts on a table that is spread over this Region Servers.
>
> So during inserts I run local java app to grab the Region Server metrics:
>
>  public void getRegionServerMetrics() throws Exception{
>        HBaseAdmin admin = new HBaseAdmin(config);
>        HTable table = new HTable(config, TABLE_NAME);
>
>        Map<HRegionInfo, HServerAddress> regionInfo =
> table.getRegionsInfo();
>
>        RegionServerMetrics metrics = new RegionServerMetrics();
>        MetricsIntValue value =
>  metrics.requests;
>
>        while(true){
>            System.out.println(metrics.toString());
>            Thread.sleep(1000);
>        }
>    }
>
> But it prints just:
>
> requests=0,
>  regions=0, stores=0, storefiles=0, storefileIndexSize=0,
> memstoreSize=0, compactionQueueSize=0, flushQueueSize=0, usedHeap=14,
> maxHeap=865, blockCacheSize=0, blockCacheFree=0, blockCacheCount=0,
> blockCacheHitCount=0, blockCacheMissCount=0, blockCacheEvictedCount=0,
> blockCacheHitRatio=0, blockCacheHitCachingRatio=0
>
> Although the WebGUI of HMaster shows that there are requests for all
> Region Servers.
>
> The TABLE_NAME is equal for the inserting app and the metrics app.
>
> Any suggestions?

Reply via email to