Skip to content

Commit

Permalink
Expose additional BulkIngester metrics (elastic#513)
Browse files Browse the repository at this point in the history
  • Loading branch information
swallez authored Feb 13, 2023
1 parent b96dca4 commit a58e933
Showing 1 changed file with 36 additions and 0 deletions.
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

0 comments on commit a58e933

Please sign in to comment.