Record Class StorageObjectMetrics
java.lang.Object
java.lang.Record
org.elasticsearch.xpack.esql.datasources.spi.StorageObjectMetrics
- Record Components:
requestCount- number of read requests issued against the underlying store (including retries)requestNanos- cumulative wall time spent opening read streams against the store (best-effort: providers measure between calling the SDK'sgetObject/reader/openInputStreamand the stream being returned; the time spent draining bytes off the network after the stream is returned is not currently captured)bytesRead- planned read bytes against the underlying store, before any decompression (best-effort: providers record the requested range length or the response Content-Length at stream-open time, not the bytes actually drained — close enough for a per-query I/O budget, not for measuring end-of-stream truncation)retryCount- number of automatic retries triggered by the underlying client. Only tracked at theRetryableStorageObjectdecorator boundary today; SDK-internal retry counts (AWS / GCS / Azure) are not yet wired
- All Implemented Interfaces:
Writeable,ToXContent,ToXContentObject
public record StorageObjectMetrics(long requestCount, long requestNanos, long bytesRead, long retryCount)
extends Record
implements Writeable, ToXContentObject
Immutable snapshot of cumulative I/O counters for a
StorageObject instance.
Counters are produced live by a StorageObjectMetricsCounters held by each
provider implementation and snapshotted via StorageObject.metrics() when
the format reader needs to surface I/O numbers in the ES|QL query profile. Snapshots
are immutable values so they ride the wire alongside operator status without
additional synchronisation.
The split (mutable counter struct vs. immutable snapshot record) mirrors the
BlobStoreActionStats / GCS Collector pattern used by repository plugins.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionStorageObjectMetrics(long requestCount, long requestNanos, long bytesRead, long retryCount) Creates an instance of aStorageObjectMetricsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionadd(StorageObjectMetrics other) Returns the element-wise sum of this andother.longReturns the value of thebytesReadrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisZero()longReturns the value of therequestCountrecord component.longReturns the value of therequestNanosrecord component.longReturns the value of theretryCountrecord component.final StringtoString()Returns a string representation of this record class.toXContent(XContentBuilder builder, ToXContent.Params params) voidwriteTo(StreamOutput out) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Field Details
-
ZERO
-
-
Constructor Details
-
StorageObjectMetrics
public StorageObjectMetrics(long requestCount, long requestNanos, long bytesRead, long retryCount) Creates an instance of aStorageObjectMetricsrecord class.- Parameters:
requestCount- the value for therequestCountrecord componentrequestNanos- the value for therequestNanosrecord componentbytesRead- the value for thebytesReadrecord componentretryCount- the value for theretryCountrecord component
-
StorageObjectMetrics
- Throws:
IOException
-
-
Method Details
-
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
add
Returns the element-wise sum of this andother. Overflow wraps silently — these are metrics counters, not invariants; a wrapped value is preferable to throwing through the producer'smetrics()call chain. ReachingLong.MAX_VALUEon any field (~9.2 * 10^18) is implausible in practice (each counter would need a corresponding number of requests / nanoseconds / bytes / retries on a single object). -
isZero
public boolean isZero() -
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='. -
requestCount
public long requestCount()Returns the value of therequestCountrecord component.- Returns:
- the value of the
requestCountrecord component
-
requestNanos
public long requestNanos()Returns the value of therequestNanosrecord component.- Returns:
- the value of the
requestNanosrecord component
-
bytesRead
public long bytesRead()Returns the value of thebytesReadrecord component.- Returns:
- the value of the
bytesReadrecord component
-
retryCount
public long retryCount()Returns the value of theretryCountrecord component.- Returns:
- the value of the
retryCountrecord component
-