1 // Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
2 // This source code is licensed under the BSD-style license found in the
3 // LICENSE file in the root directory of this source tree. An additional grant
4 // of patent rights can be found in the PATENTS file in the same directory.
9 * Statistics to analyze the performance of a db. Pointer for statistics object
10 * is managed by Options class.
12 public class Statistics
{
14 private final long statsHandle_
;
16 public Statistics(final long statsHandle
) {
17 statsHandle_
= statsHandle
;
20 public long getTickerCount(TickerType tickerType
) {
21 assert(isInitialized());
22 return getTickerCount0(tickerType
.getValue(), statsHandle_
);
25 public HistogramData
getHistogramData(final HistogramType histogramType
) {
26 assert(isInitialized());
27 return getHistogramData0(
28 histogramType
.getValue(), statsHandle_
);
31 private boolean isInitialized() {
32 return (statsHandle_
!= 0);
35 private native long getTickerCount0(int tickerType
, long handle
);
36 private native HistogramData
getHistogramData0(int histogramType
, long handle
);