Module org.elasticsearch.xcore
Class DataCounts
java.lang.Object
org.elasticsearch.xpack.core.ml.job.process.autodetect.state.DataCounts
- All Implemented Interfaces:
Writeable,org.elasticsearch.xcontent.ToXContent,org.elasticsearch.xcontent.ToXContentObject
public final class DataCounts
extends Object
implements org.elasticsearch.xcontent.ToXContentObject, Writeable
Job processed record counts.
The getInput... methods return the actual number of fields/records sent the API including invalid records. The getProcessed... methods are the number sent to the Engine.
The inputRecordCount field is calculated so it
should not be set in deserialisation but it should be serialised
so the field is visible.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
org.elasticsearch.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.xcontent.ToXContent.MapParams, org.elasticsearch.xcontent.ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ConstructingObjectParser<DataCounts, Void> static final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionDataCounts(String jobId) DataCounts(String jobId, long processedRecordCount, long processedFieldCount, long inputBytes, long inputFieldCount, long invalidDateCount, long missingFieldCount, long outOfOrderTimeStampCount, long emptyBucketCount, long sparseBucketCount, long bucketCount, Date earliestRecordTimeStamp, Date latestRecordTimeStamp, Date lastDataTimeStamp, Date latestEmptyBucketTimeStamp, Date latestSparseBucketTimeStamp, Instant logTime) DataCounts(DataCounts lhs) -
Method Summary
Modifier and TypeMethodDescriptionvoidcalcProcessedFieldCount(long analysisFieldsPerRecord) static StringdocumentId(String jobId) org.elasticsearch.xcontent.XContentBuilderdoXContentBody(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) booleanEquality testlongThe number of buckets overall.The time of the first record seen.longThe number of buckets with no records in it.longThe total number of bytes sent to this job.longThe total number of fields sent to the job including fields that aren't analysed.longTotal number of input records read.longThe number of records with an invalid date field that could not be parsed or converted to epoch time.getJobId()The wall clock time the latest record was seen.The time of the latest empty bucket seen.The time of the latest record seen.The time of the latest sparse bucket seen.longThe number of missing fields that had been configured for analysis.longThe number of records with a timestamp that is before the time of the latest record.longNumber of data points (processed record count * the number of analysed fields) processed by this job.longNumber of records processed by this job.longThe number of buckets with few records compared to the overall counts.inthashCode()voidincrementBucketCount(long additional) voidincrementEmptyBucketCount(long additional) voidincrementInputBytes(long additional) voidincrementInputFieldCount(long additional) voidincrementInvalidDateCount(long additional) voidincrementMissingFieldCount(long additional) voidincrementOutOfOrderTimeStampCount(long additional) voidincrementProcessedRecordCount(long additional) voidincrementSparseBucketCount(long additional) voidsetEarliestRecordTimeStamp(Date timeStamp) IfearliestRecordTimeStamphas not been set (i.e.voidsetLastDataTimeStamp(Date lastDataTimeStamp) voidsetLatestEmptyBucketTimeStamp(Date latestEmptyBucketTimeStamp) voidsetLatestRecordTimeStamp(Date latestRecordTimeStamp) voidsetLatestSparseBucketTimeStamp(Date latestSparseBucketTimeStamp) voidsetLogTime(Instant logTime) org.elasticsearch.xcontent.XContentBuildertoXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) voidupdateLatestEmptyBucketTimeStamp(Date timestamp) voidupdateLatestSparseBucketTimeStamp(Date timestamp) static Stringv54DocumentId(String jobId) voidwriteTo(StreamOutput out) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Field Details
-
PROCESSED_RECORD_COUNT
public static final org.elasticsearch.xcontent.ParseField PROCESSED_RECORD_COUNT -
PROCESSED_FIELD_COUNT
public static final org.elasticsearch.xcontent.ParseField PROCESSED_FIELD_COUNT -
INPUT_BYTES
public static final org.elasticsearch.xcontent.ParseField INPUT_BYTES -
INPUT_RECORD_COUNT
public static final org.elasticsearch.xcontent.ParseField INPUT_RECORD_COUNT -
INPUT_FIELD_COUNT
public static final org.elasticsearch.xcontent.ParseField INPUT_FIELD_COUNT -
INVALID_DATE_COUNT
public static final org.elasticsearch.xcontent.ParseField INVALID_DATE_COUNT -
MISSING_FIELD_COUNT
public static final org.elasticsearch.xcontent.ParseField MISSING_FIELD_COUNT -
OUT_OF_ORDER_TIME_COUNT
public static final org.elasticsearch.xcontent.ParseField OUT_OF_ORDER_TIME_COUNT -
EMPTY_BUCKET_COUNT
public static final org.elasticsearch.xcontent.ParseField EMPTY_BUCKET_COUNT -
SPARSE_BUCKET_COUNT
public static final org.elasticsearch.xcontent.ParseField SPARSE_BUCKET_COUNT -
BUCKET_COUNT
public static final org.elasticsearch.xcontent.ParseField BUCKET_COUNT -
EARLIEST_RECORD_TIME
public static final org.elasticsearch.xcontent.ParseField EARLIEST_RECORD_TIME -
LATEST_RECORD_TIME
public static final org.elasticsearch.xcontent.ParseField LATEST_RECORD_TIME -
LAST_DATA_TIME
public static final org.elasticsearch.xcontent.ParseField LAST_DATA_TIME -
LATEST_EMPTY_BUCKET_TIME
public static final org.elasticsearch.xcontent.ParseField LATEST_EMPTY_BUCKET_TIME -
LATEST_SPARSE_BUCKET_TIME
public static final org.elasticsearch.xcontent.ParseField LATEST_SPARSE_BUCKET_TIME -
LOG_TIME
public static final org.elasticsearch.xcontent.ParseField LOG_TIME -
TYPE
public static final org.elasticsearch.xcontent.ParseField TYPE -
PARSER
-
-
Constructor Details
-
DataCounts
public DataCounts(String jobId, long processedRecordCount, long processedFieldCount, long inputBytes, long inputFieldCount, long invalidDateCount, long missingFieldCount, long outOfOrderTimeStampCount, long emptyBucketCount, long sparseBucketCount, long bucketCount, Date earliestRecordTimeStamp, Date latestRecordTimeStamp, Date lastDataTimeStamp, Date latestEmptyBucketTimeStamp, Date latestSparseBucketTimeStamp, Instant logTime) -
DataCounts
-
DataCounts
-
DataCounts
- Throws:
IOException
-
-
Method Details
-
documentId
-
v54DocumentId
-
getJobId
-
getProcessedRecordCount
public long getProcessedRecordCount()Number of records processed by this job. This value is the number of records sent passed on to the engine i.e. getInputRecordCount() minus records with bad dates or out of order- Returns:
- Number of records processed by this job
long
-
incrementProcessedRecordCount
public void incrementProcessedRecordCount(long additional) -
getProcessedFieldCount
public long getProcessedFieldCount()Number of data points (processed record count * the number of analysed fields) processed by this job. This count does not include the time field.- Returns:
- Number of data points processed by this job
long
-
calcProcessedFieldCount
public void calcProcessedFieldCount(long analysisFieldsPerRecord) -
getInputRecordCount
public long getInputRecordCount()Total number of input records read. This = processed record count + date parse error records count + out of order record count.Records with missing fields are counted as they are still written.
- Returns:
- Total number of input records read
long
-
getInputBytes
public long getInputBytes()The total number of bytes sent to this job. This value includes the bytes from any records that have been discarded for any reason e.g. because the date cannot be read- Returns:
- Volume in bytes
-
incrementInputBytes
public void incrementInputBytes(long additional) -
getInputFieldCount
public long getInputFieldCount()The total number of fields sent to the job including fields that aren't analysed.- Returns:
- The total number of fields sent to the job
-
incrementInputFieldCount
public void incrementInputFieldCount(long additional) -
getInvalidDateCount
public long getInvalidDateCount()The number of records with an invalid date field that could not be parsed or converted to epoch time.- Returns:
- The number of records with an invalid date field
-
incrementInvalidDateCount
public void incrementInvalidDateCount(long additional) -
getMissingFieldCount
public long getMissingFieldCount()The number of missing fields that had been configured for analysis.- Returns:
- The number of missing fields
-
incrementMissingFieldCount
public void incrementMissingFieldCount(long additional) -
getOutOfOrderTimeStampCount
public long getOutOfOrderTimeStampCount()The number of records with a timestamp that is before the time of the latest record. Records should be in ascending chronological order- Returns:
- The number of records with a timestamp that is before the time of the latest record
-
incrementOutOfOrderTimeStampCount
public void incrementOutOfOrderTimeStampCount(long additional) -
getEmptyBucketCount
public long getEmptyBucketCount()The number of buckets with no records in it. Used to measure general data fitness and/or configuration problems (bucket span).- Returns:
- Number of empty buckets processed by this job
long
-
incrementEmptyBucketCount
public void incrementEmptyBucketCount(long additional) -
getSparseBucketCount
public long getSparseBucketCount()The number of buckets with few records compared to the overall counts. Used to measure general data fitness and/or configuration problems (bucket span).- Returns:
- Number of sparse buckets processed by this job
long
-
incrementSparseBucketCount
public void incrementSparseBucketCount(long additional) -
getBucketCount
public long getBucketCount()The number of buckets overall.- Returns:
- Number of buckets processed by this job
long
-
incrementBucketCount
public void incrementBucketCount(long additional) -
getEarliestRecordTimeStamp
The time of the first record seen.- Returns:
- The first record time
-
setEarliestRecordTimeStamp
IfearliestRecordTimeStamphas not been set (i.e. isnull) then set it totimeStamp- Parameters:
timeStamp- Candidate time- Throws:
IllegalStateException- ifearliestRecordTimeStampis already set
-
getLatestRecordTimeStamp
The time of the latest record seen.- Returns:
- Latest record time
-
setLatestRecordTimeStamp
-
getLastDataTimeStamp
The wall clock time the latest record was seen.- Returns:
- Wall clock time of the lastest record
-
setLastDataTimeStamp
-
getLatestEmptyBucketTimeStamp
The time of the latest empty bucket seen.- Returns:
- Latest empty bucket time
-
setLatestEmptyBucketTimeStamp
-
updateLatestEmptyBucketTimeStamp
-
getLatestSparseBucketTimeStamp
The time of the latest sparse bucket seen.- Returns:
- Latest sparse bucket time
-
setLatestSparseBucketTimeStamp
-
updateLatestSparseBucketTimeStamp
-
setLogTime
-
getLogTime
-
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
toXContent
public org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceorg.elasticsearch.xcontent.ToXContent- Throws:
IOException
-
doXContentBody
public org.elasticsearch.xcontent.XContentBuilder doXContentBody(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException - Throws:
IOException
-
equals
Equality test -
hashCode
public int hashCode()
-