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

[Backport 8.7] Expose additional BulkIngester metrics #515

Merged
merged 1 commit into from
Feb 13, 2023
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -130,18 +130,31 @@ private BulkIngester(Builder<Context> builder) {

//----- Getters

/**
* The configured max operations to buffer in a single bulk request.
*/
public int maxOperations() {
return this.maxOperations;
}

/**
* The configured maximum size in bytes for a bulk request. Operations are added to the request until
* adding an operation leads the request to exceed this siz.
*/
public long maxSize() {
return this.maxSize;
}

/**
* The configured maximum number of concurrent request sent to Elasticsearch.
*/
public int maxConcurrentRequests() {
return this.maxRequests;
}

/**
* The configured flush period.
*/
public Duration flushInterval() {
if (this.flushIntervalMillis != null) {
return Duration.ofMillis(flushIntervalMillis);
Expand All @@ -150,6 +163,29 @@ public Duration flushInterval() {
}
}

/**
* The number of operations that have been buffered, waiting to be sent.
*/
public int pendingOperations() {
List<BulkOperation> operations = this.operations;
return operations == null ? 0 : operations.size();
}

/**
* The size in bytes of operations that have been buffered, waiting to be sent.
*/
public long pendingOperationsSize() {
return this.currentSize;
}


/**
* The number of in flight bulk requests.
*/
public int pendingRequests() {
return this.requestsInFlightCount;
}

//----- Statistics

/**
Expand Down