mirror of https://github.com/apache/activemq.git
MQ-2404 : Configurable KahaDBStore verbosity.. -Dorg.apache.activemq.store.kahadb.LOG_SLOW_ACCESS_TIME=300 system prop now supported.
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@818224 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
15c2c96609
commit
35658c7c7b
|
@ -59,12 +59,16 @@ import org.apache.kahadb.util.*;
|
||||||
|
|
||||||
public class MessageDatabase {
|
public class MessageDatabase {
|
||||||
|
|
||||||
|
public static final String PROPERTY_LOG_SLOW_ACCESS_TIME = "org.apache.activemq.store.kahadb.LOG_SLOW_ACCESS_TIME";
|
||||||
|
public static final int LOG_SLOW_ACCESS_TIME = Integer.parseInt(System.getProperty(PROPERTY_LOG_SLOW_ACCESS_TIME, "500"));
|
||||||
|
|
||||||
private static final Log LOG = LogFactory.getLog(MessageDatabase.class);
|
private static final Log LOG = LogFactory.getLog(MessageDatabase.class);
|
||||||
private static final int DATABASE_LOCKED_WAIT_DELAY = 10 * 1000;
|
private static final int DATABASE_LOCKED_WAIT_DELAY = 10 * 1000;
|
||||||
|
|
||||||
public static final int CLOSED_STATE = 1;
|
public static final int CLOSED_STATE = 1;
|
||||||
public static final int OPEN_STATE = 2;
|
public static final int OPEN_STATE = 2;
|
||||||
|
|
||||||
|
|
||||||
protected class Metadata {
|
protected class Metadata {
|
||||||
protected Page<Metadata> page;
|
protected Page<Metadata> page;
|
||||||
protected int state;
|
protected int state;
|
||||||
|
@ -566,8 +570,8 @@ public class MessageDatabase {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
long end = System.currentTimeMillis();
|
long end = System.currentTimeMillis();
|
||||||
if( end-start > 100 ) {
|
if( LOG_SLOW_ACCESS_TIME>0 && end-start > LOG_SLOW_ACCESS_TIME) {
|
||||||
LOG.info("KahaDB Cleanup took "+(end-start));
|
LOG.info("Slow KahaDB access: cleanup took "+(end-start));
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
@ -612,8 +616,8 @@ public class MessageDatabase {
|
||||||
long start2 = System.currentTimeMillis();
|
long start2 = System.currentTimeMillis();
|
||||||
process(data, location);
|
process(data, location);
|
||||||
long end = System.currentTimeMillis();
|
long end = System.currentTimeMillis();
|
||||||
if( end-start > 100 ) {
|
if( LOG_SLOW_ACCESS_TIME>0 && end-start > LOG_SLOW_ACCESS_TIME) {
|
||||||
LOG.info("KahaDB long enqueue time: Journal Add Took: "+(start2-start)+" ms, Index Update took "+(end-start2)+" ms");
|
LOG.info("Slow KahaDB access: Journal append took: "+(start2-start)+" ms, Index update took "+(end-start2)+" ms");
|
||||||
}
|
}
|
||||||
|
|
||||||
synchronized (indexMutex) {
|
synchronized (indexMutex) {
|
||||||
|
|
Loading…
Reference in New Issue