Skip to content
Browse files

Make all bdb stats calls fast by default

  • Loading branch information...
1 parent a97edf2 commit 56c71c662db41a60195c0501c66a85ff1d12223f @afeinberg afeinberg committed Aug 24, 2011
View
13 src/java/voldemort/store/bdb/BdbStorageConfiguration.java
@@ -199,9 +199,9 @@ public String getType() {
return TYPE_NAME;
}
- public EnvironmentStats getStats(String storeName) {
+ public EnvironmentStats getStats(String storeName, boolean fast) {
StatsConfig config = new StatsConfig();
- config.setFast(false);
+ config.setFast(fast);
try {
Environment env = getEnvironment(storeName);
return env.getStats(config);
@@ -210,9 +210,14 @@ public EnvironmentStats getStats(String storeName) {
}
}
- @JmxOperation(description = "A variety of stats about one BDB environment.")
+ @JmxOperation(description = "A variety of quickly calculated stats about one BDB environment.")
public String getEnvStatsAsString(String storeName) throws Exception {
- String envStats = getStats(storeName).toString();
+ return getEnvStatsAsString(storeName, true);
+ }
+
+ @JmxOperation(description = "A variety of stats about one BDB environment.")
+ public String getEnvStatsAsString(String storeName, boolean fast) throws Exception {
+ String envStats = getStats(storeName, fast).toString();
logger.debug("Bdb Environment stats:\n" + envStats);
return envStats;
}
View
12 src/java/voldemort/store/bdb/BdbStorageEngine.java
@@ -444,10 +444,16 @@ public DatabaseStats getStats(boolean setFast) {
}
}
- @JmxOperation(description = "A variety of stats about the BDB for this store.")
+ @JmxOperation(description = "A variety of quickly computable stats about the BDB for this store.")
public String getBdbStats() {
- String stats = getStats(false).toString();
- return stats;
+ return getBdbStats(true);
+ }
+
+ @JmxOperation(description = "A variety of stats about the BDB for this store.")
+ public String getBdbStats(boolean fast) {
+ String dbStats = getStats(fast).toString();
+ logger.debug(dbStats);
+ return dbStats;
}
private static abstract class BdbIterator<T> implements ClosableIterator<T> {

0 comments on commit 56c71c6

Please sign in to comment.
Something went wrong with that request. Please try again.