Skip to content

Commit

Permalink
[DE-876] added missing statistics to CursorStats: documentLookups, in…
Browse files Browse the repository at this point in the history
…termediat… (#580)

* added missing statistics to CursorStats: documentLookups, intermediateCommits, seeks

* test fix
  • Loading branch information
rashtao authored Oct 22, 2024
1 parent 00449ee commit cc67275
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 5 deletions.
21 changes: 21 additions & 0 deletions core/src/main/java/com/arangodb/entity/CursorStats.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ public final class CursorStats {
private Long fullCount;
private Double executionTime;
private Long peakMemoryUsage;
private Integer documentLookups;
private Integer intermediateCommits;
private Integer seeks;

@JsonAnySetter
public void add(String key, Object value) {
Expand Down Expand Up @@ -142,4 +145,22 @@ public Double getExecutionTime() {
public Long getPeakMemoryUsage() {
return peakMemoryUsage;
}

public Integer getDocumentLookups() {
return documentLookups;
}

/**
* @return The total number of intermediate commits the query has performed. This number can only be greater than
* zero for data-modification queries that perform modifications beyond the `--rocksdb.intermediate-commit-count`
* or `--rocksdb.intermediate-commit-size` thresholds. In a cluster, the intermediate commits are tracked per
* DB-Server that participates in the query and are summed up in the end.
*/
public Integer getIntermediateCommits() {
return intermediateCommits;
}

public Integer getSeeks() {
return seeks;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,11 @@ void queryStats(ArangoDatabaseAsync db) throws ExecutionException, InterruptedEx
assertThat(cursor.getExtra().getStats().getFiltered()).isNotNull();
assertThat(cursor.getExtra().getStats().getExecutionTime()).isNotNull();
assertThat(cursor.getExtra().getStats().getPeakMemoryUsage()).isNotNull();
assertThat(cursor.getExtra().getStats().getIntermediateCommits()).isNotNull();
if (isAtLeastVersion(3, 12)) {
assertThat(cursor.getExtra().getStats().getDocumentLookups()).isNotNull();
assertThat(cursor.getExtra().getStats().getSeeks()).isNotNull();
}
}

@ParameterizedTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -662,11 +662,14 @@ void queryStats(ArangoDatabase db) {
assertThat(cursor.getStats().getFiltered()).isNotNull();
assertThat(cursor.getStats().getExecutionTime()).isNotNull();
assertThat(cursor.getStats().getPeakMemoryUsage()).isNotNull();
if (isAtLeastVersion(3, 10)) {
assertThat(cursor.getStats().getCursorsCreated()).isNotNull();
assertThat(cursor.getStats().getCursorsRearmed()).isNotNull();
assertThat(cursor.getStats().getCacheHits()).isNotNull();
assertThat(cursor.getStats().getCacheMisses()).isNotNull();
assertThat(cursor.getStats().getCursorsCreated()).isNotNull();
assertThat(cursor.getStats().getCursorsRearmed()).isNotNull();
assertThat(cursor.getStats().getCacheHits()).isNotNull();
assertThat(cursor.getStats().getCacheMisses()).isNotNull();
assertThat(cursor.getStats().getIntermediateCommits()).isNotNull();
if (isAtLeastVersion(3, 12)) {
assertThat(cursor.getStats().getDocumentLookups()).isNotNull();
assertThat(cursor.getStats().getSeeks()).isNotNull();
}
}

Expand Down

0 comments on commit cc67275

Please sign in to comment.