Skip to content

Commit

Permalink
feat: add execution time in millis to reply data
Browse files Browse the repository at this point in the history
  • Loading branch information
janfh committed Jan 6, 2025
1 parent f5c2333 commit 1cd44b5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/com/github/ibm/mapepire/ClientRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.sql.SQLException;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;

import com.github.theprez.jcmdutils.StringUtils;
import com.google.gson.Gson;
Expand Down Expand Up @@ -82,8 +83,11 @@ protected void processAfterReplySent() {
@Override
public void run() {
try {
long startTime = System.nanoTime();
go();
long endTime = System.nanoTime();
addReplyData("success", true);
addReplyData("execution_time", TimeUnit.NANOSECONDS.toMillis(endTime - startTime));
} catch (final Exception _e) {
Tracer.err(_e);
addReplyData("error", "" + getErrorStringFromException(_e));
Expand Down

0 comments on commit 1cd44b5

Please sign in to comment.