mirror of
https://github.com/XRPLF/rippled.git
synced 2026-01-09 17:25:35 +00:00
Add statistics object
This commit is contained in:
@@ -34,11 +34,13 @@ public class RocksDBSample {
|
||||
}
|
||||
|
||||
options.setCreateIfMissing(true)
|
||||
.createStatistics()
|
||||
.setWriteBufferSize(8 * SizeUnit.KB)
|
||||
.setMaxWriteBufferNumber(3)
|
||||
.setDisableSeekCompaction(true)
|
||||
.setBlockSize(64 * SizeUnit.KB)
|
||||
.setMaxBackgroundCompactions(10);
|
||||
Statistics stats = new Statistics(options.statisticsPtr());
|
||||
|
||||
assert(options.createIfMissing() == true);
|
||||
assert(options.writeBufferSize() == 8 * SizeUnit.KB);
|
||||
@@ -120,13 +122,25 @@ public class RocksDBSample {
|
||||
assert(new String(testValue).equals(
|
||||
new String(enoughArray, 0, len)));
|
||||
writeOpts.dispose();
|
||||
|
||||
try {
|
||||
for(StatisticsType statsType : StatisticsType.values()) {
|
||||
stats.getTickerCount(statsType);
|
||||
}
|
||||
System.out.println("getTickerCount() passed.");
|
||||
}
|
||||
catch(Exception e) {
|
||||
System.out.println("Failed in call to getTickerCount()");
|
||||
assert(false); //Should never reach here.
|
||||
}
|
||||
|
||||
} catch (RocksDBException e) {
|
||||
System.err.println(e);
|
||||
}
|
||||
if (db != null) {
|
||||
db.close();
|
||||
}
|
||||
// be sure to dispose c++ pointer
|
||||
// be sure to dispose c++ pointers
|
||||
options.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user