]> git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/java/src/main/java/org/rocksdb/Statistics.java
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / rocksdb / java / src / main / java / org / rocksdb / Statistics.java
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.
5
6 package org.rocksdb;
7
8 /**
9 * Statistics to analyze the performance of a db. Pointer for statistics object
10 * is managed by Options class.
11 */
12 public class Statistics {
13
14 private final long statsHandle_;
15
16 public Statistics(final long statsHandle) {
17 statsHandle_ = statsHandle;
18 }
19
20 public long getTickerCount(TickerType tickerType) {
21 assert(isInitialized());
22 return getTickerCount0(tickerType.getValue(), statsHandle_);
23 }
24
25 public HistogramData getHistogramData(final HistogramType histogramType) {
26 assert(isInitialized());
27 return getHistogramData0(
28 histogramType.getValue(), statsHandle_);
29 }
30
31 private boolean isInitialized() {
32 return (statsHandle_ != 0);
33 }
34
35 private native long getTickerCount0(int tickerType, long handle);
36 private native HistogramData getHistogramData0(int histogramType, long handle);
37 }