Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DE-876] added missing statistics to CursorStats: documentLookups, intermediat… #580

Merged
merged 2 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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