Skip to content

Commit

Permalink
add info (#74)
Browse files Browse the repository at this point in the history
* add info

* start time
  • Loading branch information
nevermore3 authored Dec 9, 2022
1 parent 026b402 commit 04a17a7
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public void executeOperation(TOperation operation, NebulaDbConnectionState state
final String queryString = getQueryString(state, operation);
state.logQuery(operation.getClass().getSimpleName(), queryString);
final ResultSet result;
long startTime = System.currentTimeMillis();
try {
result = session.execute(queryString);
if (state.isPrintErrors() && !result.isSucceeded()) {
Expand All @@ -46,6 +47,11 @@ 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());
System.out.println("threadID : " + threadID + " startTime : " + startTime / 1000 + " consumeTime : " + consumeTime);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public abstract class NebulaMultipleUpdateOperationHandler<TOperation extends Op
@Override
public void executeOperation(TOperation operation, NebulaDbConnectionState state, ResultReporter resultReporter) throws DbException {
Session session = state.getSession();
long startTime = System.currentTimeMillis();
try {
List<String> queryStrings = getQueryString(state, operation);
for (String queryString : queryStrings) {
Expand All @@ -27,6 +28,11 @@ 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());
System.out.println("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 @@ -16,10 +16,10 @@ public abstract class NebulaSingletonOperationHandler <TOperation extends Operat
@Override
public void executeOperation(TOperation operation, NebulaDbConnectionState state, ResultReporter resultReporter) throws DbException {
Session session = state.getSession();
long startTime = System.currentTimeMillis();
try {
TOperationResult tuple = null;
int resultCount = 0;

final String queryString = getQueryString(state, operation);
state.logQuery(operation.getClass().getSimpleName(), queryString);
final ResultSet result = session.execute(queryString);
Expand All @@ -44,6 +44,11 @@ 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) / 1000;
System.out.println("Query SimpleName : " + operation.getClass().getSimpleName());
System.out.println("threadID : " + threadID + " startTime : " + startTime / 1000 + " consumeTime : " + consumeTime);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public abstract class NebulaUpdateOperationHandler <TOperation extends Operation
@Override
public void executeOperation(TOperation operation, NebulaDbConnectionState state, ResultReporter resultReporter) throws DbException {
Session session = state.getSession();
long startTime = System.currentTimeMillis();
try {
final String queryString = getQueryString(state, operation);
state.logQuery(operation.getClass().getSimpleName(), queryString);
Expand All @@ -23,6 +24,11 @@ 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());
System.out.println("threadID : " + threadID + " startTime : " + startTime / 1000 + " consumeTime : " + consumeTime);
}
resultReporter.report(0, LdbcNoResult.INSTANCE, operation);
}
Expand Down

0 comments on commit 04a17a7

Please sign in to comment.