|
| 1 | +.. Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +.. or more contributor license agreements. See the NOTICE file |
| 3 | +.. distributed with this work for additional information |
| 4 | +.. regarding copyright ownership. The ASF licenses this file |
| 5 | +.. to you under the Apache License, Version 2.0 (the |
| 6 | +.. "License"); you may not use this file except in compliance |
| 7 | +.. with the License. You may obtain a copy of the License at |
| 8 | +
|
| 9 | +.. http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +
|
| 11 | +.. Unless required by applicable law or agreed to in writing, |
| 12 | +.. software distributed under the License is distributed on an |
| 13 | +.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +.. KIND, either express or implied. See the License for the |
| 15 | +.. specific language governing permissions and limitations |
| 16 | +.. under the License. |
| 17 | +
|
| 18 | +Metrics reference |
| 19 | +================= |
| 20 | + |
| 21 | +``Metrics`` contains counters, gauges, and histogram snapshots. A counter is a non-negative |
| 22 | +integer, a gauge represents current state, and a histogram records a distribution of observed |
| 23 | +values. The scan, prefetch-reader, and read-ahead-cache metrics described below are returned as |
| 24 | +point-in-time snapshots. Modifying a returned snapshot does not modify the component that produced |
| 25 | +it. |
| 26 | + |
| 27 | +Scan planning |
| 28 | +------------- |
| 29 | + |
| 30 | +The names below are declared by ``ScanMetrics``. ``last*`` counters are replaced after each |
| 31 | +successful ``CreatePlan()`` call. Histograms and the cache hit/miss counters accumulate for the |
| 32 | +lifetime of the scan. They are unrelated to ``SetReadSchema()`` and ``ReadAheadCache::Reset()``. |
| 33 | + |
| 34 | +.. csv-table:: |
| 35 | + :header: "Name", "Type", "Unit", "Meaning" |
| 36 | + :widths: 34, 12, 12, 52 |
| 37 | + |
| 38 | + "lastScanDuration", "counter", "milliseconds", "Duration of the last successful plan" |
| 39 | + "scanDuration", "histogram", "milliseconds", "Distribution of successful plan durations" |
| 40 | + "lastScannedSnapshotId", "counter", "snapshot ID", "Snapshot used by the last plan, or 0" |
| 41 | + "lastScannedManifests", "counter", "files", "Manifest files selected by the last plan" |
| 42 | + "lastScanSkippedTableFiles", "counter", "files", "Table files skipped by the last plan" |
| 43 | + "lastScanResultedTableFiles", "counter", "files", "Table files returned by the last plan" |
| 44 | + "lastManifestReadDuration", "counter", "milliseconds", "Manifest-list and entry read time for the last plan" |
| 45 | + "manifestReadDuration", "histogram", "milliseconds", "Distribution of manifest read times" |
| 46 | + "lastSnapshotCacheEnabled", "counter", "boolean", "Whether snapshot manifest-entry cache was eligible" |
| 47 | + "lastSnapshotCacheHit", "counter", "boolean", "Whether the last eligible lookup hit" |
| 48 | + "snapshotCacheHits", "counter", "lookups", "Cumulative exact-snapshot cache hits" |
| 49 | + "snapshotCacheMisses", "counter", "lookups", "Cumulative eligible cache misses" |
| 50 | + "lastSnapshotCacheLoadDuration", "counter", "milliseconds", "Cache load time for the last plan" |
| 51 | + "snapshotCacheLoadDuration", "histogram", "milliseconds", "Distribution of cache load times" |
| 52 | + "lastSnapshotCacheStoreDuration", "counter", "milliseconds", "Cache store time for the last plan; 0 when not stored" |
| 53 | + "snapshotCacheStoreDuration", "histogram", "milliseconds", "Distribution of cache store times" |
| 54 | + "lastLazyDecodeScannedRows", "counter", "manifest rows", "Candidate manifest rows inspected by the last plan" |
| 55 | + "lastLazyDecodeMaterializedRows", "counter", "manifest rows", "Manifest rows retained after lazy filtering" |
| 56 | + |
| 57 | +Prefetch reader |
| 58 | +--------------- |
| 59 | + |
| 60 | +The names below are declared by ``PrefetchMetrics``. Counters and histograms accumulate for the |
| 61 | +lifetime of the prefetch reader, including across ``SetReadSchema()``. ``enabled`` and |
| 62 | +``parallelism`` describe the most recently initialized schema. ``queue-depth`` is reset by |
| 63 | +``SetReadSchema()`` and ``Close()``; ``queue-depth.max`` remains the lifetime maximum. |
| 64 | + |
| 65 | +.. csv-table:: |
| 66 | + :header: "Name", "Type", "Unit", "Meaning" |
| 67 | + :widths: 38, 12, 12, 48 |
| 68 | + |
| 69 | + "prefetch.enabled", "gauge", "boolean", "Whether the most recently initialized schema selected prefetch" |
| 70 | + "prefetch.parallelism", "gauge", "readers", "Effective reader parallelism" |
| 71 | + "prefetch.read-ranges.total", "counter", "ranges", "Generated ranges before bitmap filtering" |
| 72 | + "prefetch.read-ranges.after-bitmap", "counter", "ranges", "Ranges retained after bitmap filtering" |
| 73 | + "prefetch.seek.count", "counter", "operations", "Underlying reader seek operations" |
| 74 | + "prefetch.produced-batches", "counter", "batches", "Data batches placed into prefetch queues" |
| 75 | + "prefetch.consumed-batches", "counter", "batches", "Data batches returned to the consumer" |
| 76 | + "prefetch.discarded-batches", "counter", "batches", "Data batches released without consumption, plus EOF entries released during cleanup" |
| 77 | + "prefetch.errors", "counter", "errors", "Errors recorded by the background prefetch loop" |
| 78 | + "prefetch.adaptive-disabled-count", "counter", "decisions", "Times adaptive strategy disabled prefetch" |
| 79 | + "prefetch.queue-full-count", "counter", "events", "Times production found a full queue" |
| 80 | + "prefetch.queue-depth", "gauge", "queue entries", "Current queued entries, including retained EOF markers" |
| 81 | + "prefetch.queue-depth.max", "gauge", "queue entries", "Maximum queued entries in the reader lifetime" |
| 82 | + "prefetch.reader-read-latency-us", "histogram", "microseconds", "Underlying reader batch latency" |
| 83 | + "prefetch.consumer-wait-latency-us", "histogram", "microseconds", "Consumer wait latency per returned batch or EOF" |
| 84 | + |
| 85 | +Prefetch I/O |
| 86 | +------------ |
| 87 | + |
| 88 | +``PrefetchIoMetrics`` describes only I/O that passes through the prefetch reader's instrumented |
| 89 | +input streams. It is not a whole-query or whole-table I/O total. All counters and histograms |
| 90 | +accumulate for the reader lifetime and are retained across ``SetReadSchema()`` and cache reset. |
| 91 | +``io.async.pending`` is current state and returns to zero when all callbacks complete. |
| 92 | + |
| 93 | +.. csv-table:: |
| 94 | + :header: "Name", "Type", "Unit", "Meaning" |
| 95 | + :widths: 34, 12, 12, 52 |
| 96 | + |
| 97 | + "io.read.requests", "counter", "requests", "Synchronous read requests" |
| 98 | + "io.read.requested-bytes", "counter", "bytes", "Bytes requested by synchronous reads" |
| 99 | + "io.read.physical-bytes", "counter", "bytes", "Bytes returned by successful synchronous reads" |
| 100 | + "io.read.failed", "counter", "requests", "Failed synchronous reads" |
| 101 | + "io.read.latency-us", "histogram", "microseconds", "Synchronous read latency" |
| 102 | + "io.async.requests", "counter", "requests", "Asynchronous read requests" |
| 103 | + "io.async.requested-bytes", "counter", "bytes", "Bytes requested by asynchronous reads" |
| 104 | + "io.async.physical-bytes", "counter", "bytes", "Bytes attributed to successful asynchronous reads" |
| 105 | + "io.async.completed", "counter", "requests", "Successful asynchronous reads" |
| 106 | + "io.async.failed", "counter", "requests", "Failed asynchronous reads" |
| 107 | + "io.async.pending", "gauge", "requests", "Asynchronous callbacks not yet completed" |
| 108 | + "io.async.latency-us", "histogram", "microseconds", "Asynchronous callback latency" |
| 109 | + |
| 110 | +Read-ahead cache |
| 111 | +---------------- |
| 112 | + |
| 113 | +The names below are declared by ``ReadAheadCacheMetrics``. Request, byte, completion, failure, |
| 114 | +eviction, and latency metrics accumulate for the cache lifetime. ``Reset()`` clears cached and |
| 115 | +pending ranges but retains those cumulative metrics. The three gauges describe current state and |
| 116 | +``cached-ranges`` and ``cached-bytes`` become zero after reset. ``pending-requests`` is not forcibly |
| 117 | +reset; it continues to track asynchronous callbacks until they complete. |
| 118 | + |
| 119 | +.. csv-table:: |
| 120 | + :header: "Name", "Type", "Unit", "Meaning" |
| 121 | + :widths: 44, 12, 12, 42 |
| 122 | + |
| 123 | + "read-ahead-cache.lookup-requests", "counter", "requests", "Cache lookup requests" |
| 124 | + "read-ahead-cache.lookup-bytes", "counter", "bytes", "Bytes requested by lookups" |
| 125 | + "read-ahead-cache.served-requests", "counter", "requests", "Lookups served from cache" |
| 126 | + "read-ahead-cache.served-bytes", "counter", "bytes", "Bytes served from cache" |
| 127 | + "read-ahead-cache.miss-requests", "counter", "requests", "Cache misses" |
| 128 | + "read-ahead-cache.miss-bytes", "counter", "bytes", "Bytes requested by misses" |
| 129 | + "read-ahead-cache.wait-requests", "counter", "requests", "Lookups that waited for prefetch" |
| 130 | + "read-ahead-cache.wait-bytes", "counter", "bytes", "Bytes requested by waiting lookups" |
| 131 | + "read-ahead-cache.prefetch-requests", "counter", "requests", "Asynchronous cache fills" |
| 132 | + "read-ahead-cache.prefetch-bytes", "counter", "bytes", "Bytes requested by cache fills" |
| 133 | + "read-ahead-cache.prefetch-completed", "counter", "requests", "Successful cache fills" |
| 134 | + "read-ahead-cache.prefetch-failed", "counter", "requests", "Failed cache fills" |
| 135 | + "read-ahead-cache.evicted-ranges", "counter", "ranges", "Ranges evicted by the size limit" |
| 136 | + "read-ahead-cache.evicted-bytes", "counter", "bytes", "Bytes evicted by the size limit" |
| 137 | + "read-ahead-cache.cached-ranges", "gauge", "ranges", "Ranges currently held in cache" |
| 138 | + "read-ahead-cache.cached-bytes", "gauge", "bytes", "Bytes currently held in cache" |
| 139 | + "read-ahead-cache.pending-requests", "gauge", "requests", "Cache fills awaiting callbacks" |
| 140 | + "read-ahead-cache.wait-latency-us", "histogram", "microseconds", "Time lookups wait for cache fills" |
| 141 | + "read-ahead-cache.prefetch-io-latency-us", "histogram", "microseconds", "Cache-fill I/O latency" |
0 commit comments