View Javadoc

1   /**
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *     http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  
19  package org.apache.hadoop.hbase.regionserver;
20  
21  import org.apache.hadoop.hbase.classification.InterfaceAudience;
22  import org.apache.hadoop.hbase.metrics.BaseSourceImpl;
23  import org.apache.hadoop.hbase.metrics.Interns;
24  import org.apache.hadoop.metrics2.MetricHistogram;
25  import org.apache.hadoop.metrics2.MetricsCollector;
26  import org.apache.hadoop.metrics2.MetricsRecordBuilder;
27  import org.apache.hadoop.metrics2.lib.MutableFastCounter;
28  
29  /**
30   * Hadoop2 implementation of MetricsRegionServerSource.
31   *
32   * Implements BaseSource through BaseSourceImpl, following the pattern
33   */
34  @InterfaceAudience.Private
35  public class MetricsRegionServerSourceImpl
36      extends BaseSourceImpl implements MetricsRegionServerSource {
37  
38    final MetricsRegionServerWrapper rsWrap;
39    private final MetricHistogram putHisto;
40    private final MetricHistogram deleteHisto;
41    private final MetricHistogram getHisto;
42    private final MetricHistogram incrementHisto;
43    private final MetricHistogram appendHisto;
44    private final MetricHistogram replayHisto;
45    private final MetricHistogram scanSizeHisto;
46    private final MetricHistogram scanTimeHisto;
47  
48    private final MutableFastCounter slowPut;
49    private final MutableFastCounter slowDelete;
50    private final MutableFastCounter slowGet;
51    private final MutableFastCounter slowIncrement;
52    private final MutableFastCounter slowAppend;
53    private final MutableFastCounter splitRequest;
54    private final MutableFastCounter splitSuccess;
55  
56    private final MetricHistogram splitTimeHisto;
57  
58    // flush related metrics
59    private final MetricHistogram flushTimeHisto;
60    private final MetricHistogram flushMemstoreSizeHisto;
61    private final MetricHistogram flushOutputSizeHisto;
62    private final MutableFastCounter flushedMemstoreBytes;
63    private final MutableFastCounter flushedOutputBytes;
64  
65    // compaction related metrics
66    private final MetricHistogram compactionTimeHisto;
67    private final MetricHistogram compactionInputFileCountHisto;
68    private final MetricHistogram compactionInputSizeHisto;
69    private final MetricHistogram compactionOutputFileCountHisto;
70    private final MetricHistogram compactionOutputSizeHisto;
71    private final MutableFastCounter compactedInputBytes;
72    private final MutableFastCounter compactedOutputBytes;
73  
74    private final MetricHistogram majorCompactionTimeHisto;
75    private final MetricHistogram majorCompactionInputFileCountHisto;
76    private final MetricHistogram majorCompactionInputSizeHisto;
77    private final MetricHistogram majorCompactionOutputFileCountHisto;
78    private final MetricHistogram majorCompactionOutputSizeHisto;
79    private final MutableFastCounter majorCompactedInputBytes;
80    private final MutableFastCounter majorCompactedOutputBytes;
81  
82    // pause monitor metrics
83    private final MutableFastCounter infoPauseThresholdExceeded;
84    private final MutableFastCounter warnPauseThresholdExceeded;
85    private final MetricHistogram pausesWithGc;
86    private final MetricHistogram pausesWithoutGc;
87  
88    public MetricsRegionServerSourceImpl(MetricsRegionServerWrapper rsWrap) {
89      this(METRICS_NAME, METRICS_DESCRIPTION, METRICS_CONTEXT, METRICS_JMX_CONTEXT, rsWrap);
90    }
91  
92    public MetricsRegionServerSourceImpl(String metricsName,
93                                         String metricsDescription,
94                                         String metricsContext,
95                                         String metricsJmxContext,
96                                         MetricsRegionServerWrapper rsWrap) {
97      super(metricsName, metricsDescription, metricsContext, metricsJmxContext);
98      this.rsWrap = rsWrap;
99  
100     putHisto = getMetricsRegistry().newTimeHistogram(MUTATE_KEY);
101     slowPut = getMetricsRegistry().newCounter(SLOW_MUTATE_KEY, SLOW_MUTATE_DESC, 0L);
102 
103     deleteHisto = getMetricsRegistry().newTimeHistogram(DELETE_KEY);
104     slowDelete = getMetricsRegistry().newCounter(SLOW_DELETE_KEY, SLOW_DELETE_DESC, 0L);
105 
106     getHisto = getMetricsRegistry().newTimeHistogram(GET_KEY);
107     slowGet = getMetricsRegistry().newCounter(SLOW_GET_KEY, SLOW_GET_DESC, 0L);
108 
109     incrementHisto = getMetricsRegistry().newTimeHistogram(INCREMENT_KEY);
110     slowIncrement = getMetricsRegistry().newCounter(SLOW_INCREMENT_KEY, SLOW_INCREMENT_DESC, 0L);
111 
112     appendHisto = getMetricsRegistry().newTimeHistogram(APPEND_KEY);
113     slowAppend = getMetricsRegistry().newCounter(SLOW_APPEND_KEY, SLOW_APPEND_DESC, 0L);
114 
115     replayHisto = getMetricsRegistry().newTimeHistogram(REPLAY_KEY);
116     scanSizeHisto = getMetricsRegistry().newSizeHistogram(SCAN_SIZE_KEY);
117     scanTimeHisto = getMetricsRegistry().newTimeHistogram(SCAN_TIME_KEY);
118 
119     flushTimeHisto = getMetricsRegistry().newTimeHistogram(FLUSH_TIME, FLUSH_TIME_DESC);
120     flushMemstoreSizeHisto = getMetricsRegistry()
121         .newSizeHistogram(FLUSH_MEMSTORE_SIZE, FLUSH_MEMSTORE_SIZE_DESC);
122     flushOutputSizeHisto = getMetricsRegistry().newSizeHistogram(FLUSH_OUTPUT_SIZE,
123       FLUSH_OUTPUT_SIZE_DESC);
124     flushedOutputBytes = getMetricsRegistry().newCounter(FLUSHED_OUTPUT_BYTES,
125       FLUSHED_OUTPUT_BYTES_DESC, 0L);
126     flushedMemstoreBytes = getMetricsRegistry().newCounter(FLUSHED_MEMSTORE_BYTES,
127       FLUSHED_MEMSTORE_BYTES_DESC, 0L);
128 
129     compactionTimeHisto = getMetricsRegistry()
130         .newTimeHistogram(COMPACTION_TIME, COMPACTION_TIME_DESC);
131     compactionInputFileCountHisto = getMetricsRegistry()
132       .newHistogram(COMPACTION_INPUT_FILE_COUNT, COMPACTION_INPUT_FILE_COUNT_DESC);
133     compactionInputSizeHisto = getMetricsRegistry()
134         .newSizeHistogram(COMPACTION_INPUT_SIZE, COMPACTION_INPUT_SIZE_DESC);
135     compactionOutputFileCountHisto = getMetricsRegistry()
136         .newHistogram(COMPACTION_OUTPUT_FILE_COUNT, COMPACTION_OUTPUT_FILE_COUNT_DESC);
137     compactionOutputSizeHisto = getMetricsRegistry()
138       .newSizeHistogram(COMPACTION_OUTPUT_SIZE, COMPACTION_OUTPUT_SIZE_DESC);
139     compactedInputBytes = getMetricsRegistry()
140         .newCounter(COMPACTED_INPUT_BYTES, COMPACTED_INPUT_BYTES_DESC, 0L);
141     compactedOutputBytes = getMetricsRegistry()
142         .newCounter(COMPACTED_OUTPUT_BYTES, COMPACTED_OUTPUT_BYTES_DESC, 0L);
143 
144     majorCompactionTimeHisto = getMetricsRegistry()
145         .newTimeHistogram(MAJOR_COMPACTION_TIME, MAJOR_COMPACTION_TIME_DESC);
146     majorCompactionInputFileCountHisto = getMetricsRegistry()
147       .newHistogram(MAJOR_COMPACTION_INPUT_FILE_COUNT, MAJOR_COMPACTION_INPUT_FILE_COUNT_DESC);
148     majorCompactionInputSizeHisto = getMetricsRegistry()
149         .newSizeHistogram(MAJOR_COMPACTION_INPUT_SIZE, MAJOR_COMPACTION_INPUT_SIZE_DESC);
150     majorCompactionOutputFileCountHisto = getMetricsRegistry()
151         .newHistogram(MAJOR_COMPACTION_OUTPUT_FILE_COUNT, MAJOR_COMPACTION_OUTPUT_FILE_COUNT_DESC);
152     majorCompactionOutputSizeHisto = getMetricsRegistry()
153       .newSizeHistogram(MAJOR_COMPACTION_OUTPUT_SIZE, MAJOR_COMPACTION_OUTPUT_SIZE_DESC);
154     majorCompactedInputBytes = getMetricsRegistry()
155         .newCounter(MAJOR_COMPACTED_INPUT_BYTES, MAJOR_COMPACTED_INPUT_BYTES_DESC, 0L);
156     majorCompactedOutputBytes = getMetricsRegistry()
157         .newCounter(MAJOR_COMPACTED_OUTPUT_BYTES, MAJOR_COMPACTED_OUTPUT_BYTES_DESC, 0L);
158 
159     splitTimeHisto = getMetricsRegistry().newTimeHistogram(SPLIT_KEY);
160     splitRequest = getMetricsRegistry().newCounter(SPLIT_REQUEST_KEY, SPLIT_REQUEST_DESC, 0L);
161     splitSuccess = getMetricsRegistry().newCounter(SPLIT_SUCCESS_KEY, SPLIT_SUCCESS_DESC, 0L);
162 
163     // pause monitor metrics
164     infoPauseThresholdExceeded = getMetricsRegistry().newCounter(INFO_THRESHOLD_COUNT_KEY,
165       INFO_THRESHOLD_COUNT_DESC, 0L);
166     warnPauseThresholdExceeded = getMetricsRegistry().newCounter(WARN_THRESHOLD_COUNT_KEY,
167       WARN_THRESHOLD_COUNT_DESC, 0L);
168     pausesWithGc = getMetricsRegistry().newTimeHistogram(PAUSE_TIME_WITH_GC_KEY);
169     pausesWithoutGc = getMetricsRegistry().newTimeHistogram(PAUSE_TIME_WITHOUT_GC_KEY);
170   }
171 
172   @Override
173   public void updatePut(long t) {
174     putHisto.add(t);
175   }
176 
177   @Override
178   public void updateDelete(long t) {
179     deleteHisto.add(t);
180   }
181 
182   @Override
183   public void updateGet(long t) {
184     getHisto.add(t);
185   }
186 
187   @Override
188   public void updateIncrement(long t) {
189     incrementHisto.add(t);
190   }
191 
192   @Override
193   public void updateAppend(long t) {
194     appendHisto.add(t);
195   }
196 
197   @Override
198   public void updateReplay(long t) {
199     replayHisto.add(t);
200   }
201 
202   @Override
203   public void updateScanSize(long scanSize) {
204     scanSizeHisto.add(scanSize);
205   }
206 
207   @Override
208   public void updateScanTime(long t) {
209     scanTimeHisto.add(t);
210   }
211 
212   @Override
213   public void incrSlowPut() {
214    slowPut.incr();
215   }
216 
217   @Override
218   public void incrSlowDelete() {
219     slowDelete.incr();
220   }
221 
222   @Override
223   public void incrSlowGet() {
224     slowGet.incr();
225   }
226 
227   @Override
228   public void incrSlowIncrement() {
229     slowIncrement.incr();
230   }
231 
232   @Override
233   public void incrSlowAppend() {
234     slowAppend.incr();
235   }
236 
237   @Override
238   public void incrSplitRequest() {
239     splitRequest.incr();
240   }
241 
242   @Override
243   public void incrSplitSuccess() {
244     splitSuccess.incr();
245   }
246 
247   @Override
248   public void updateSplitTime(long t) {
249     splitTimeHisto.add(t);
250   }
251 
252   @Override
253   public void updateFlushTime(long t) {
254     flushTimeHisto.add(t);
255   }
256 
257   @Override
258   public void updateFlushMemstoreSize(long bytes) {
259     flushMemstoreSizeHisto.add(bytes);
260     flushedMemstoreBytes.incr(bytes);
261   }
262 
263   @Override
264   public void updateFlushOutputSize(long bytes) {
265     flushOutputSizeHisto.add(bytes);
266     flushedOutputBytes.incr(bytes);
267   }
268 
269   @Override
270   public void updateCompactionTime(boolean isMajor, long t) {
271     compactionTimeHisto.add(t);
272     if (isMajor) {
273       majorCompactionTimeHisto.add(t);
274     }
275   }
276 
277   @Override
278   public void updateCompactionInputFileCount(boolean isMajor, long c) {
279     compactionInputFileCountHisto.add(c);
280     if (isMajor) {
281       majorCompactionInputFileCountHisto.add(c);
282     }
283   }
284 
285   @Override
286   public void updateCompactionInputSize(boolean isMajor, long bytes) {
287     compactionInputSizeHisto.add(bytes);
288     compactedInputBytes.incr(bytes);
289     if (isMajor) {
290       majorCompactionInputSizeHisto.add(bytes);
291       majorCompactedInputBytes.incr(bytes);
292     }
293   }
294 
295   @Override
296   public void updateCompactionOutputFileCount(boolean isMajor, long c) {
297     compactionOutputFileCountHisto.add(c);
298     if (isMajor) {
299       majorCompactionOutputFileCountHisto.add(c);
300     }
301   }
302 
303   @Override
304   public void updateCompactionOutputSize(boolean isMajor, long bytes) {
305     compactionOutputSizeHisto.add(bytes);
306     compactedOutputBytes.incr(bytes);
307     if (isMajor) {
308       majorCompactionOutputSizeHisto.add(bytes);
309       majorCompactedOutputBytes.incr(bytes);
310     }
311   }
312 
313   /**
314    * Yes this is a get function that doesn't return anything.  Thanks Hadoop for breaking all
315    * expectations of java programmers.  Instead of returning anything Hadoop metrics expects
316    * getMetrics to push the metrics into the collector.
317    *
318    * @param metricsCollector Collector to accept metrics
319    * @param all              push all or only changed?
320    */
321   @Override
322   public void getMetrics(MetricsCollector metricsCollector, boolean all) {
323 
324     MetricsRecordBuilder mrb = metricsCollector.addRecord(metricsName);
325 
326     // rsWrap can be null because this function is called inside of init.
327     if (rsWrap != null) {
328       mrb.addGauge(Interns.info(REGION_COUNT, REGION_COUNT_DESC), rsWrap.getNumOnlineRegions())
329           .addGauge(Interns.info(STORE_COUNT, STORE_COUNT_DESC), rsWrap.getNumStores())
330           .addGauge(Interns.info(WALFILE_COUNT, WALFILE_COUNT_DESC), rsWrap.getNumWALFiles())
331           .addGauge(Interns.info(WALFILE_SIZE, WALFILE_SIZE_DESC), rsWrap.getWALFileSize())
332           .addGauge(Interns.info(STOREFILE_COUNT, STOREFILE_COUNT_DESC), rsWrap.getNumStoreFiles())
333           .addGauge(Interns.info(MEMSTORE_SIZE, MEMSTORE_SIZE_DESC), rsWrap.getMemstoreSize())
334           .addGauge(Interns.info(STOREFILE_SIZE, STOREFILE_SIZE_DESC), rsWrap.getStoreFileSize())
335           .addGauge(Interns.info(MAX_STORE_FILE_AGE, MAX_STORE_FILE_AGE_DESC),
336               rsWrap.getMaxStoreFileAge())
337           .addGauge(Interns.info(MIN_STORE_FILE_AGE, MIN_STORE_FILE_AGE_DESC),
338               rsWrap.getMinStoreFileAge())
339           .addGauge(Interns.info(AVG_STORE_FILE_AGE, AVG_STORE_FILE_AGE_DESC),
340               rsWrap.getAvgStoreFileAge())
341           .addGauge(Interns.info(NUM_REFERENCE_FILES, NUM_REFERENCE_FILES_DESC),
342               rsWrap.getNumReferenceFiles())
343           .addGauge(Interns.info(RS_START_TIME_NAME, RS_START_TIME_DESC),
344               rsWrap.getStartCode())
345           .addGauge(Interns.info(AVERAGE_REGION_SIZE, AVERAGE_REGION_SIZE_DESC), rsWrap.getAverageRegionSize())
346           .addCounter(Interns.info(TOTAL_REQUEST_COUNT, TOTAL_REQUEST_COUNT_DESC),
347               rsWrap.getTotalRequestCount())
348           .addCounter(Interns.info(READ_REQUEST_COUNT, READ_REQUEST_COUNT_DESC),
349               rsWrap.getReadRequestsCount())
350           .addCounter(Interns.info(FILTERED_READ_REQUEST_COUNT, FILTERED_READ_REQUEST_COUNT_DESC),
351               rsWrap.getFilteredReadRequestsCount())
352           .addCounter(Interns.info(WRITE_REQUEST_COUNT, WRITE_REQUEST_COUNT_DESC),
353               rsWrap.getWriteRequestsCount())
354           .addCounter(Interns.info(RPC_GET_REQUEST_COUNT, RPC_GET_REQUEST_COUNT_DESC),
355             rsWrap.getRpcGetRequestsCount())
356           .addCounter(Interns.info(RPC_SCAN_REQUEST_COUNT, RPC_SCAN_REQUEST_COUNT_DESC),
357             rsWrap.getRpcScanRequestsCount())
358           .addCounter(Interns.info(RPC_MULTI_REQUEST_COUNT, RPC_MULTI_REQUEST_COUNT_DESC),
359             rsWrap.getRpcMultiRequestsCount())
360           .addCounter(Interns.info(RPC_MUTATE_REQUEST_COUNT, RPC_MUTATE_REQUEST_COUNT_DESC),
361             rsWrap.getRpcMutateRequestsCount())
362           .addCounter(Interns.info(CHECK_MUTATE_FAILED_COUNT, CHECK_MUTATE_FAILED_COUNT_DESC),
363               rsWrap.getCheckAndMutateChecksFailed())
364           .addCounter(Interns.info(CHECK_MUTATE_PASSED_COUNT, CHECK_MUTATE_PASSED_COUNT_DESC),
365               rsWrap.getCheckAndMutateChecksPassed())
366           .addGauge(Interns.info(STOREFILE_INDEX_SIZE, STOREFILE_INDEX_SIZE_DESC),
367               rsWrap.getStoreFileIndexSize())
368           .addGauge(Interns.info(STATIC_INDEX_SIZE, STATIC_INDEX_SIZE_DESC),
369               rsWrap.getTotalStaticIndexSize())
370           .addGauge(Interns.info(STATIC_BLOOM_SIZE, STATIC_BLOOM_SIZE_DESC),
371             rsWrap.getTotalStaticBloomSize())
372           .addGauge(
373             Interns.info(NUMBER_OF_MUTATIONS_WITHOUT_WAL, NUMBER_OF_MUTATIONS_WITHOUT_WAL_DESC),
374               rsWrap.getNumMutationsWithoutWAL())
375           .addGauge(Interns.info(DATA_SIZE_WITHOUT_WAL, DATA_SIZE_WITHOUT_WAL_DESC),
376               rsWrap.getDataInMemoryWithoutWAL())
377           .addGauge(Interns.info(PERCENT_FILES_LOCAL, PERCENT_FILES_LOCAL_DESC),
378               rsWrap.getPercentFileLocal())
379           .addGauge(Interns.info(PERCENT_FILES_LOCAL_SECONDARY_REGIONS,
380               PERCENT_FILES_LOCAL_SECONDARY_REGIONS_DESC),
381               rsWrap.getPercentFileLocalSecondaryRegions())
382           .addGauge(Interns.info(SPLIT_QUEUE_LENGTH, SPLIT_QUEUE_LENGTH_DESC),
383               rsWrap.getSplitQueueSize())
384           .addGauge(Interns.info(COMPACTION_QUEUE_LENGTH, COMPACTION_QUEUE_LENGTH_DESC),
385               rsWrap.getCompactionQueueSize())
386           .addGauge(Interns.info(SMALL_COMPACTION_QUEUE_LENGTH, SMALL_COMPACTION_QUEUE_LENGTH_DESC),
387             rsWrap.getSmallCompactionQueueSize())
388           .addGauge(Interns.info(LARGE_COMPACTION_QUEUE_LENGTH, LARGE_COMPACTION_QUEUE_LENGTH_DESC),
389             rsWrap.getLargeCompactionQueueSize())
390           .addGauge(Interns.info(COMPACTION_QUEUE_LENGTH, COMPACTION_QUEUE_LENGTH_DESC),
391             rsWrap.getCompactionQueueSize())
392           .addGauge(Interns.info(FLUSH_QUEUE_LENGTH, FLUSH_QUEUE_LENGTH_DESC),
393               rsWrap.getFlushQueueSize())
394 
395           .addGauge(Interns.info(BLOCK_CACHE_FREE_SIZE, BLOCK_CACHE_FREE_DESC),
396               rsWrap.getBlockCacheFreeSize())
397           .addGauge(Interns.info(BLOCK_CACHE_COUNT, BLOCK_CACHE_COUNT_DESC),
398               rsWrap.getBlockCacheCount())
399           .addGauge(Interns.info(BLOCK_CACHE_SIZE, BLOCK_CACHE_SIZE_DESC),
400               rsWrap.getBlockCacheSize())
401           .addCounter(Interns.info(BLOCK_CACHE_HIT_COUNT, BLOCK_CACHE_HIT_COUNT_DESC),
402               rsWrap.getBlockCacheHitCount())
403           .addCounter(Interns.info(BLOCK_CACHE_PRIMARY_HIT_COUNT,
404             BLOCK_CACHE_PRIMARY_HIT_COUNT_DESC), rsWrap.getBlockCachePrimaryHitCount())
405           .addCounter(Interns.info(BLOCK_CACHE_MISS_COUNT, BLOCK_COUNT_MISS_COUNT_DESC),
406               rsWrap.getBlockCacheMissCount())
407           .addCounter(Interns.info(BLOCK_CACHE_PRIMARY_MISS_COUNT,
408             BLOCK_COUNT_PRIMARY_MISS_COUNT_DESC), rsWrap.getBlockCachePrimaryMissCount())
409           .addCounter(Interns.info(BLOCK_CACHE_EVICTION_COUNT, BLOCK_CACHE_EVICTION_COUNT_DESC),
410               rsWrap.getBlockCacheEvictedCount())
411           .addCounter(Interns.info(BLOCK_CACHE_PRIMARY_EVICTION_COUNT,
412             BLOCK_CACHE_PRIMARY_EVICTION_COUNT_DESC), rsWrap.getBlockCachePrimaryEvictedCount())
413           .addGauge(Interns.info(BLOCK_CACHE_HIT_PERCENT, BLOCK_CACHE_HIT_PERCENT_DESC),
414               rsWrap.getBlockCacheHitPercent())
415           .addGauge(Interns.info(BLOCK_CACHE_EXPRESS_HIT_PERCENT,
416               BLOCK_CACHE_EXPRESS_HIT_PERCENT_DESC), rsWrap.getBlockCacheHitCachingPercent())
417           .addCounter(Interns.info(BLOCK_CACHE_FAILED_INSERTION_COUNT,
418               BLOCK_CACHE_FAILED_INSERTION_COUNT_DESC),rsWrap.getBlockCacheFailedInsertions())
419           .addCounter(Interns.info(BLOCK_CACHE_DATA_MISS_COUNT, ""), rsWrap.getDataMissCount())
420           .addCounter(Interns.info(BLOCK_CACHE_LEAF_INDEX_MISS_COUNT, ""),
421               rsWrap.getLeafIndexMissCount())
422           .addCounter(Interns.info(BLOCK_CACHE_BLOOM_CHUNK_MISS_COUNT, ""),
423               rsWrap.getBloomChunkMissCount())
424           .addCounter(Interns.info(BLOCK_CACHE_META_MISS_COUNT, ""), rsWrap.getMetaMissCount())
425           .addCounter(Interns.info(BLOCK_CACHE_ROOT_INDEX_MISS_COUNT, ""),
426               rsWrap.getRootIndexMissCount())
427           .addCounter(Interns.info(BLOCK_CACHE_INTERMEDIATE_INDEX_MISS_COUNT, ""),
428               rsWrap.getIntermediateIndexMissCount())
429           .addCounter(Interns.info(BLOCK_CACHE_FILE_INFO_MISS_COUNT, ""),
430               rsWrap.getFileInfoMissCount())
431           .addCounter(Interns.info(BLOCK_CACHE_GENERAL_BLOOM_META_MISS_COUNT, ""),
432               rsWrap.getGeneralBloomMetaMissCount())
433           .addCounter(Interns.info(BLOCK_CACHE_DELETE_FAMILY_BLOOM_MISS_COUNT, ""),
434               rsWrap.getDeleteFamilyBloomMissCount())
435           .addCounter(Interns.info(BLOCK_CACHE_TRAILER_MISS_COUNT, ""),
436               rsWrap.getTrailerMissCount())
437           .addCounter(Interns.info(BLOCK_CACHE_DATA_HIT_COUNT, ""), rsWrap.getDataHitCount())
438           .addCounter(Interns.info(BLOCK_CACHE_LEAF_INDEX_HIT_COUNT, ""),
439               rsWrap.getLeafIndexHitCount())
440           .addCounter(Interns.info(BLOCK_CACHE_BLOOM_CHUNK_HIT_COUNT, ""),
441               rsWrap.getBloomChunkHitCount())
442           .addCounter(Interns.info(BLOCK_CACHE_META_HIT_COUNT, ""), rsWrap.getMetaHitCount())
443           .addCounter(Interns.info(BLOCK_CACHE_ROOT_INDEX_HIT_COUNT, ""),
444               rsWrap.getRootIndexHitCount())
445           .addCounter(Interns.info(BLOCK_CACHE_INTERMEDIATE_INDEX_HIT_COUNT, ""),
446               rsWrap.getIntermediateIndexHitCount())
447           .addCounter(Interns.info(BLOCK_CACHE_FILE_INFO_HIT_COUNT, ""),
448               rsWrap.getFileInfoHitCount())
449           .addCounter(Interns.info(BLOCK_CACHE_GENERAL_BLOOM_META_HIT_COUNT, ""),
450               rsWrap.getGeneralBloomMetaHitCount())
451           .addCounter(Interns.info(BLOCK_CACHE_DELETE_FAMILY_BLOOM_HIT_COUNT, ""),
452               rsWrap.getDeleteFamilyBloomHitCount())
453           .addCounter(Interns.info(BLOCK_CACHE_TRAILER_HIT_COUNT, ""), rsWrap.getTrailerHitCount())
454           .addCounter(Interns.info(UPDATES_BLOCKED_TIME, UPDATES_BLOCKED_DESC),
455               rsWrap.getUpdatesBlockedTime())
456           .addCounter(Interns.info(FLUSHED_CELLS, FLUSHED_CELLS_DESC),
457               rsWrap.getFlushedCellsCount())
458           .addCounter(Interns.info(COMPACTED_CELLS, COMPACTED_CELLS_DESC),
459               rsWrap.getCompactedCellsCount())
460           .addCounter(Interns.info(MAJOR_COMPACTED_CELLS, MAJOR_COMPACTED_CELLS_DESC),
461               rsWrap.getMajorCompactedCellsCount())
462           .addCounter(Interns.info(FLUSHED_CELLS_SIZE, FLUSHED_CELLS_SIZE_DESC),
463               rsWrap.getFlushedCellsSize())
464           .addCounter(Interns.info(COMPACTED_CELLS_SIZE, COMPACTED_CELLS_SIZE_DESC),
465               rsWrap.getCompactedCellsSize())
466           .addCounter(Interns.info(MAJOR_COMPACTED_CELLS_SIZE, MAJOR_COMPACTED_CELLS_SIZE_DESC),
467               rsWrap.getMajorCompactedCellsSize())
468           .addCounter(
469               Interns.info(CELLS_COUNT_COMPACTED_FROM_MOB, CELLS_COUNT_COMPACTED_FROM_MOB_DESC),
470               rsWrap.getCellsCountCompactedFromMob())
471           .addCounter(Interns.info(CELLS_COUNT_COMPACTED_TO_MOB, CELLS_COUNT_COMPACTED_TO_MOB_DESC),
472               rsWrap.getCellsCountCompactedToMob())
473           .addCounter(
474               Interns.info(CELLS_SIZE_COMPACTED_FROM_MOB, CELLS_SIZE_COMPACTED_FROM_MOB_DESC),
475               rsWrap.getCellsSizeCompactedFromMob())
476           .addCounter(Interns.info(CELLS_SIZE_COMPACTED_TO_MOB, CELLS_SIZE_COMPACTED_TO_MOB_DESC),
477               rsWrap.getCellsSizeCompactedToMob())
478           .addCounter(Interns.info(MOB_FLUSH_COUNT, MOB_FLUSH_COUNT_DESC),
479               rsWrap.getMobFlushCount())
480           .addCounter(Interns.info(MOB_FLUSHED_CELLS_COUNT, MOB_FLUSHED_CELLS_COUNT_DESC),
481               rsWrap.getMobFlushedCellsCount())
482           .addCounter(Interns.info(MOB_FLUSHED_CELLS_SIZE, MOB_FLUSHED_CELLS_SIZE_DESC),
483               rsWrap.getMobFlushedCellsSize())
484           .addCounter(Interns.info(MOB_SCAN_CELLS_COUNT, MOB_SCAN_CELLS_COUNT_DESC),
485               rsWrap.getMobScanCellsCount())
486           .addCounter(Interns.info(MOB_SCAN_CELLS_SIZE, MOB_SCAN_CELLS_SIZE_DESC),
487               rsWrap.getMobScanCellsSize())
488           .addGauge(Interns.info(MOB_FILE_CACHE_COUNT, MOB_FILE_CACHE_COUNT_DESC),
489               rsWrap.getMobFileCacheCount())
490           .addCounter(Interns.info(MOB_FILE_CACHE_ACCESS_COUNT, MOB_FILE_CACHE_ACCESS_COUNT_DESC),
491               rsWrap.getMobFileCacheAccessCount())
492           .addCounter(Interns.info(MOB_FILE_CACHE_MISS_COUNT, MOB_FILE_CACHE_MISS_COUNT_DESC),
493               rsWrap.getMobFileCacheMissCount())
494           .addCounter(
495               Interns.info(MOB_FILE_CACHE_EVICTED_COUNT, MOB_FILE_CACHE_EVICTED_COUNT_DESC),
496               rsWrap.getMobFileCacheEvictedCount())
497           .addGauge(Interns.info(MOB_FILE_CACHE_HIT_PERCENT, MOB_FILE_CACHE_HIT_PERCENT_DESC),
498               rsWrap.getMobFileCacheHitPercent())
499 
500           .addCounter(Interns.info(HEDGED_READS, HEDGED_READS_DESC), rsWrap.getHedgedReadOps())
501           .addCounter(Interns.info(HEDGED_READ_WINS, HEDGED_READ_WINS_DESC),
502               rsWrap.getHedgedReadWins())
503           .addCounter(Interns.info(BLOCKED_REQUESTS_COUNT, BLOCKED_REQUESTS_COUNT_DESC),
504             rsWrap.getBlockedRequestsCount())
505           .tag(Interns.info(ZOOKEEPER_QUORUM_NAME, ZOOKEEPER_QUORUM_DESC),
506               rsWrap.getZookeeperQuorum())
507           .tag(Interns.info(SERVER_NAME_NAME, SERVER_NAME_DESC), rsWrap.getServerName())
508           .tag(Interns.info(CLUSTER_ID_NAME, CLUSTER_ID_DESC), rsWrap.getClusterId());
509 
510     }
511 
512     metricsRegistry.snapshot(mrb, all);
513   }
514 
515   @Override
516   public void incInfoThresholdExceeded(int count) {
517     infoPauseThresholdExceeded.incr(count);
518   }
519 
520   @Override
521   public void incWarnThresholdExceeded(int count) {
522     warnPauseThresholdExceeded.incr(count);
523   }
524 
525   @Override
526   public void updatePauseTimeWithGc(long t) {
527     pausesWithGc.add(t);
528   }
529 
530   @Override
531   public void updatePauseTimeWithoutGc(long t) {
532     pausesWithoutGc.add(t);
533   }
534 }