Skip to content

Commit

Permalink
fix(#18): corrected execution metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
novoj committed Jun 5, 2024
1 parent afa3c0b commit 07453ab
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ public class FinishedEvent extends AbstractQueryEvent {
* Creation timestamp.
*/
private final long created;
private long planned;

public FinishedEvent(
@Nonnull String catalogName,
Expand All @@ -124,7 +125,9 @@ public FinishedEvent(
*/
@Nonnull
public FinishedEvent startExecuting() {
this.planDurationMilliseconds = System.currentTimeMillis() - this.created;
final long now = System.currentTimeMillis();
this.planDurationMilliseconds = now - this.created;
this.planned = now;
return this;
}

Expand All @@ -144,7 +147,7 @@ public FinishedEvent finish(
long complexityInfo
) {
this.end();
this.executionDurationMilliseconds = System.currentTimeMillis() - this.created;
this.executionDurationMilliseconds = System.currentTimeMillis() - this.planned;
this.prefetched = prefetchInfo ? "yes" : "no";
this.scanned = recordsScannedTotal;
this.returned = recordsReturnedTotal;
Expand Down

0 comments on commit 07453ab

Please sign in to comment.