-
Notifications
You must be signed in to change notification settings - Fork 25.3k
[Transform] fixing naming in HLRC and _cat to match API content #54300
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
Changes from all commits
19e5486
1694e3e
2998669
6f8751a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,6 @@ | |
|
||
package org.elasticsearch.client.transform.transforms; | ||
|
||
import org.elasticsearch.client.core.IndexerJobStats; | ||
import org.elasticsearch.common.ParseField; | ||
import org.elasticsearch.common.xcontent.ConstructingObjectParser; | ||
import org.elasticsearch.common.xcontent.XContentParser; | ||
|
@@ -29,11 +28,24 @@ | |
|
||
import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; | ||
|
||
public class TransformIndexerStats extends IndexerJobStats { | ||
public class TransformIndexerStats { | ||
public static final String NAME = "transform_indexer_stats"; | ||
|
||
static ParseField EXPONENTIAL_AVG_CHECKPOINT_DURATION_MS = new ParseField("exponential_avg_checkpoint_duration_ms"); | ||
static ParseField EXPONENTIAL_AVG_DOCUMENTS_INDEXED = new ParseField("exponential_avg_documents_indexed"); | ||
static ParseField EXPONENTIAL_AVG_DOCUMENTS_PROCESSED = new ParseField("exponential_avg_documents_processed"); | ||
static ParseField PAGES_PROCESSED = new ParseField("pages_processed"); | ||
static ParseField DOCUMENTS_PROCESSED = new ParseField("documents_processed"); | ||
static ParseField DOCUMENTS_INDEXED = new ParseField("documents_indexed"); | ||
static ParseField TRIGGER_COUNT = new ParseField("trigger_count"); | ||
static ParseField INDEX_TIME_IN_MS = new ParseField("index_time_in_ms"); | ||
static ParseField SEARCH_TIME_IN_MS = new ParseField("search_time_in_ms"); | ||
static ParseField PROCESSING_TIME_IN_MS = new ParseField("processing_time_in_ms"); | ||
static ParseField INDEX_TOTAL = new ParseField("index_total"); | ||
static ParseField SEARCH_TOTAL = new ParseField("search_total"); | ||
static ParseField PROCESSING_TOTAL = new ParseField("processing_total"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This also doesn't appear in https://www.elastic.co/guide/en/elasticsearch/reference/master/get-transform-stats.html There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think it should be in stats. I am not 100% sure it should be in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Likewise this will be fixed in #54368 |
||
static ParseField SEARCH_FAILURES = new ParseField("search_failures"); | ||
static ParseField INDEX_FAILURES = new ParseField("index_failures"); | ||
|
||
public static final ConstructingObjectParser<TransformIndexerStats, Void> LENIENT_PARSER = new ConstructingObjectParser<>( | ||
NAME, | ||
|
@@ -58,10 +70,10 @@ public class TransformIndexerStats extends IndexerJobStats { | |
); | ||
|
||
static { | ||
LENIENT_PARSER.declareLong(optionalConstructorArg(), NUM_PAGES); | ||
LENIENT_PARSER.declareLong(optionalConstructorArg(), NUM_INPUT_DOCUMENTS); | ||
LENIENT_PARSER.declareLong(optionalConstructorArg(), NUM_OUTPUT_DOCUMENTS); | ||
LENIENT_PARSER.declareLong(optionalConstructorArg(), NUM_INVOCATIONS); | ||
LENIENT_PARSER.declareLong(optionalConstructorArg(), PAGES_PROCESSED); | ||
LENIENT_PARSER.declareLong(optionalConstructorArg(), DOCUMENTS_PROCESSED); | ||
LENIENT_PARSER.declareLong(optionalConstructorArg(), DOCUMENTS_INDEXED); | ||
LENIENT_PARSER.declareLong(optionalConstructorArg(), TRIGGER_COUNT); | ||
LENIENT_PARSER.declareLong(optionalConstructorArg(), INDEX_TIME_IN_MS); | ||
LENIENT_PARSER.declareLong(optionalConstructorArg(), SEARCH_TIME_IN_MS); | ||
LENIENT_PARSER.declareLong(optionalConstructorArg(), PROCESSING_TIME_IN_MS); | ||
|
@@ -82,12 +94,24 @@ public static TransformIndexerStats fromXContent(XContentParser parser) throws I | |
private final double expAvgCheckpointDurationMs; | ||
private final double expAvgDocumentsIndexed; | ||
private final double expAvgDocumentsProcessed; | ||
private final long pagesProcessed; | ||
private final long documentsProcessed; | ||
private final long documentsIndexed; | ||
private final long triggerCount; | ||
private final long indexTime; | ||
private final long indexTotal; | ||
private final long searchTime; | ||
private final long searchTotal; | ||
private final long processingTime; | ||
private final long processingTotal; | ||
private final long indexFailures; | ||
private final long searchFailures; | ||
|
||
public TransformIndexerStats( | ||
long numPages, | ||
long numInputDocuments, | ||
long numOuputDocuments, | ||
long numInvocations, | ||
long pagesProcessed, | ||
long documentsProcessed, | ||
long documentsIndexed, | ||
long triggerCount, | ||
long indexTime, | ||
long searchTime, | ||
long processingTime, | ||
|
@@ -100,20 +124,18 @@ public TransformIndexerStats( | |
double expAvgDocumentsIndexed, | ||
double expAvgDocumentsProcessed | ||
) { | ||
super( | ||
numPages, | ||
numInputDocuments, | ||
numOuputDocuments, | ||
numInvocations, | ||
indexTime, | ||
searchTime, | ||
processingTime, | ||
indexTotal, | ||
searchTotal, | ||
processingTotal, | ||
indexFailures, | ||
searchFailures | ||
); | ||
this.pagesProcessed = pagesProcessed; | ||
this.documentsProcessed = documentsProcessed; | ||
this.documentsIndexed = documentsIndexed; | ||
this.triggerCount = triggerCount; | ||
this.indexTime = indexTime; | ||
this.indexTotal = indexTotal; | ||
this.searchTime = searchTime; | ||
this.searchTotal = searchTotal; | ||
this.processingTime = processingTime; | ||
this.processingTotal = processingTotal; | ||
this.indexFailures = indexFailures; | ||
this.searchFailures = searchFailures; | ||
this.expAvgCheckpointDurationMs = expAvgCheckpointDurationMs; | ||
this.expAvgDocumentsIndexed = expAvgDocumentsIndexed; | ||
this.expAvgDocumentsProcessed = expAvgDocumentsProcessed; | ||
|
@@ -131,6 +153,127 @@ public double getExpAvgDocumentsProcessed() { | |
return expAvgDocumentsProcessed; | ||
} | ||
|
||
/** | ||
* The number of pages read from the input indices | ||
*/ | ||
public long getPagesProcessed() { | ||
return pagesProcessed; | ||
} | ||
|
||
/** | ||
* The number of documents read from the input indices | ||
*/ | ||
public long getDocumentsProcessed() { | ||
return documentsProcessed; | ||
} | ||
|
||
/** | ||
* Number of times that the job woke up to write documents | ||
*/ | ||
public long getTriggerCount() { | ||
return triggerCount; | ||
} | ||
|
||
/** | ||
* Number of documents written | ||
*/ | ||
public long getDocumentsIndexed() { | ||
return documentsIndexed; | ||
} | ||
|
||
/** | ||
* The number of pages read from the input indices | ||
* Deprecated, use {@link TransformIndexerStats#getPagesProcessed()} instead | ||
*/ | ||
@Deprecated | ||
public long getNumPages() { | ||
return getPagesProcessed(); | ||
} | ||
|
||
/** | ||
* The number of documents read from the input indices | ||
* Deprecated, use {@link TransformIndexerStats#getDocumentsProcessed()} instead | ||
*/ | ||
@Deprecated | ||
public long getNumDocuments() { | ||
return getDocumentsProcessed(); | ||
} | ||
|
||
/** | ||
* Number of times that the job woke up to write documents | ||
* Deprecated, use {@link TransformIndexerStats#getTriggerCount()} instead | ||
*/ | ||
@Deprecated | ||
public long getNumInvocations() { | ||
return getTriggerCount(); | ||
} | ||
|
||
/** | ||
* Number of documents written | ||
* Deprecated, use {@link TransformIndexerStats#getDocumentsIndexed()} instead | ||
*/ | ||
@Deprecated | ||
public long getOutputDocuments() { | ||
return getDocumentsIndexed(); | ||
} | ||
|
||
/** | ||
* Number of index failures that have occurred | ||
*/ | ||
public long getIndexFailures() { | ||
return indexFailures; | ||
} | ||
|
||
/** | ||
* Number of failures that have occurred | ||
*/ | ||
public long getSearchFailures() { | ||
return searchFailures; | ||
} | ||
|
||
/** | ||
* Returns the time spent indexing (cumulative) in milliseconds | ||
*/ | ||
public long getIndexTime() { | ||
return indexTime; | ||
} | ||
|
||
/** | ||
* Returns the time spent searching (cumulative) in milliseconds | ||
*/ | ||
public long getSearchTime() { | ||
return searchTime; | ||
} | ||
|
||
/** | ||
* Returns the time spent processing (cumulative) in milliseconds | ||
*/ | ||
public long getProcessingTime() { | ||
return processingTime; | ||
} | ||
|
||
/** | ||
* Returns the total number of indexing requests that have been processed | ||
* (Note: this is not the number of _documents_ that have been indexed) | ||
*/ | ||
public long getIndexTotal() { | ||
return indexTotal; | ||
} | ||
|
||
/** | ||
* Returns the total number of search requests that have been made | ||
*/ | ||
public long getSearchTotal() { | ||
return searchTotal; | ||
} | ||
|
||
/** | ||
* Returns the total number of processing runs that have been made | ||
*/ | ||
public long getProcessingTotal() { | ||
return processingTotal; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object other) { | ||
if (this == other) { | ||
|
@@ -143,10 +286,10 @@ public boolean equals(Object other) { | |
|
||
TransformIndexerStats that = (TransformIndexerStats) other; | ||
|
||
return Objects.equals(this.numPages, that.numPages) | ||
&& Objects.equals(this.numInputDocuments, that.numInputDocuments) | ||
&& Objects.equals(this.numOuputDocuments, that.numOuputDocuments) | ||
&& Objects.equals(this.numInvocations, that.numInvocations) | ||
return Objects.equals(this.pagesProcessed, that.pagesProcessed) | ||
&& Objects.equals(this.documentsProcessed, that.documentsProcessed) | ||
&& Objects.equals(this.documentsIndexed, that.documentsIndexed) | ||
&& Objects.equals(this.triggerCount, that.triggerCount) | ||
&& Objects.equals(this.indexTime, that.indexTime) | ||
&& Objects.equals(this.searchTime, that.searchTime) | ||
&& Objects.equals(this.processingTime, that.processingTime) | ||
|
@@ -163,10 +306,10 @@ public boolean equals(Object other) { | |
@Override | ||
public int hashCode() { | ||
return Objects.hash( | ||
numPages, | ||
numInputDocuments, | ||
numOuputDocuments, | ||
numInvocations, | ||
pagesProcessed, | ||
documentsProcessed, | ||
documentsIndexed, | ||
triggerCount, | ||
indexTime, | ||
searchTime, | ||
processingTime, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean we need to add this property to the stats object in https://www.elastic.co/guide/en/elasticsearch/reference/master/get-transform-stats.html ?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, that's my fault. In #53770 I added
processing_time_in_ms
andprocessing_total
.The 2 are counterparts of the search and index one:
The amount of time processing results, in milliseconds.
The number of processing operations.
This is basically what happens between search and index and shows the time/load the transform task itself used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I've created #54368 to add those.