Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions java/src/main/java/com/genexus/GXProcedure.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ public GXProcedure(int remoteHandle, ModelContext context, String location) {

public GXProcedure(boolean inNewUTL, int remoteHandle, ModelContext context, String location) {
//JMX Counter
beginExecute = new Date();
ProcedureInfo pInfo = ProceduresInfo.addProcedureInfo(this.getClass().getName());
pInfo.incCount();
if (Application.isJMXEnabled()) {
beginExecute = new Date();
ProcedureInfo pInfo = ProceduresInfo.addProcedureInfo(this.getClass().getName());
pInfo.incCount();
}

this.remoteHandle = remoteHandle;
this.context = context;
Expand Down Expand Up @@ -148,8 +150,10 @@ private void exitApplication(boolean flushBuffers) {
}

public void endExecute(String name) {
ProcedureInfo pInfo = ProceduresInfo.getProcedureInfo(name);
pInfo.setTimeExecute(System.currentTimeMillis() - beginExecute.getTime());
if (Application.isJMXEnabled()) {
ProcedureInfo pInfo = ProceduresInfo.getProcedureInfo(name);
pInfo.setTimeExecute(System.currentTimeMillis() - beginExecute.getTime());
}

if (context != null && context.getSessionContext() != null) {
ApplicationContext.getInstance().setEJB(false);
Expand Down
31 changes: 15 additions & 16 deletions java/src/main/java/com/genexus/db/DataStoreProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,17 @@ public DataStoreProvider(ModelContext context, int remoteHandle, ILocalDataStore
super(context, remoteHandle);

//JMX Enabled
if (Application.isJMXEnabled())
if (firstTime.get())
{
if (Application.isJMXEnabled()) {
if (firstTime.get()) {
DataStoreProvidersJMX.CreateDataStoreProvidersJMX();
firstTime.set(false);
}
addDataStoreProviderInfo(helper.getClass().getName());
}

this.helper = helper;
this.cursors = helper.getCursors();
setOutputBuffers(buffers);

//JMX
addDataStoreProviderInfo(helper.getClass().getName());

}

public void setErrorBuffers(int cursorIdx, Object[] buffers)
Expand Down Expand Up @@ -716,18 +713,20 @@ void beginExecute()

void incSentencesCount(String key, Cursor cursor)
{

DataStoreProviderInfo dsInfo = getDataStoreProviderInfo(key);
dsInfo.incSentenceCount();
SentenceInfo sInfo;
if (cursor.dynStatement) {
sInfo = dsInfo.addSentenceInfo(key + "_" + cursor.mCursorId, key
DataStoreProviderInfo dsInfo = null;
if (Application.isJMXEnabled()) {
dsInfo = getDataStoreProviderInfo(key);
dsInfo.incSentenceCount();
SentenceInfo sInfo;
if (cursor.dynStatement) {
sInfo = dsInfo.addSentenceInfo(key + "_" + cursor.mCursorId, key
+ "_" + cursor.mCursorId + "_" + cursor.mSQLSentence);
} else {
sInfo = dsInfo.addSentenceInfo(key + "_" + cursor.mCursorId,
} else {
sInfo = dsInfo.addSentenceInfo(key + "_" + cursor.mCursorId,
cursor.mSQLSentence);
}
sInfo.incSentenceCount();
}
sInfo.incSentenceCount();

String sqlSnt = cursor.mSQLSentence;
sentenceCount.incrementAndGet();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,13 @@

import java.io.PrintStream;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.concurrent.ConcurrentHashMap;

import com.genexus.Application;

public class ProceduresInfo
{
static private Hashtable<String, ProcedureInfo> procedureInfo = new Hashtable<>();

public ProceduresInfo()
{
}
static private ConcurrentHashMap<String, ProcedureInfo> procedureInfo = new ConcurrentHashMap<>();

static public void dump(PrintStream out)
{
Expand Down