Skip to content

Commit

Permalink
add ic debug info (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
nevermore3 authored Dec 9, 2022
1 parent dad7c36 commit f0d98b4
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ public void executeOperation(TOperation operation, NebulaDbConnectionState state

} catch (Exception e) {
throw new DbException(e);
} finally {
long threadID = Thread.currentThread().getId();
long consumeTime = (System.currentTimeMillis() - startTime);
String name = operation.getClass().getSimpleName();
if (name.startsWith("LdbcQuery")) {
// only output IC query
System.out.println("Query SimpleName : " + name + " threadID : " + threadID + " startTime : " + startTime / 1000 + " consumeTime : " + consumeTime + "ms");
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ public void executeOperation(TOperation operation, NebulaDbConnectionState state
}
} catch (Exception e) {
throw new DbException(e);
} finally {
long threadID = Thread.currentThread().getId();
long consumeTime = (System.currentTimeMillis() - startTime) / 1000;
// System.out.println("Query SimpleName : " + operation.getClass().getSimpleName() + " threadID : " + threadID + " startTime : " + startTime / 1000 + " consumeTime : " + consumeTime);
}
resultReporter.report(0, LdbcNoResult.INSTANCE, operation);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ public void executeOperation(TOperation operation, NebulaDbConnectionState state
resultReporter.report(resultCount, tuple, operation);
} catch (Exception e) {
throw new DbException(e);
} finally {
long threadID = Thread.currentThread().getId();
long consumeTime = (System.currentTimeMillis() - startTime);
String name = operation.getClass().getSimpleName();
if (name.startsWith("LdbcQuery")) {
// only output IC query
System.out.println("Query SimpleName : " + name + " threadID : " + threadID + " startTime : " + startTime / 1000 + " consumeTime : " + consumeTime + "ms");
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,21 @@ public abstract class NebulaUpdateOperationHandler <TOperation extends Operation
@Override
public void executeOperation(TOperation operation, NebulaDbConnectionState state, ResultReporter resultReporter) throws DbException {
Session session = state.getSession();
try {
final String queryString = getQueryString(state, operation);
state.logQuery(operation.getClass().getSimpleName(), queryString);
ResultSet result = session.execute(queryString);
if (state.isPrintErrors() && !result.isSucceeded()) {
System.out.println(result.getErrorMessage());
}
} catch (Exception e) {
throw new DbException(e);
long startTime = System.currentTimeMillis();
try {
final String queryString = getQueryString(state, operation);
state.logQuery(operation.getClass().getSimpleName(), queryString);
ResultSet result = session.execute(queryString);
if (state.isPrintErrors() && !result.isSucceeded()) {
System.out.println(result.getErrorMessage());
}
} catch (Exception e) {
throw new DbException(e);
} finally {
long threadID = Thread.currentThread().getId();
long consumeTime = (System.currentTimeMillis() - startTime) / 1000;
// System.out.println("Query SimpleName : " + operation.getClass().getSimpleName() + " threadID : " + threadID + " startTime : " + startTime / 1000 + " consumeTime : " + consumeTime);
}
resultReporter.report(0, LdbcNoResult.INSTANCE, operation);
}
}

0 comments on commit f0d98b4

Please sign in to comment.