sanjeet006py commented on code in PR #21:
URL: https://github.com/apache/phoenix-site/pull/21#discussion_r3267857257


##########
app/pages/_docs/docs/_mdx/(multi-page)/features/metrics.mdx:
##########
@@ -117,3 +117,82 @@ service.submit(new Runnable() {
     }
 });
 ```
+
+## Scan latency metrics [#scan-latency-metrics]
+
+Phoenix 5.3.1 surfaces HBase's per-scan latency and IO metrics through the
+request-level metrics API, giving per-query visibility into where a scan
+actually spent its time
+([PHOENIX-7704](https://issues.apache.org/jira/browse/PHOENIX-7704)).
+
+| Metric                       | Description                                   
                          |
+| ---------------------------- | 
----------------------------------------------------------------------- |
+| `FS_READ_TIME`               | Time (ms) spent in the underlying filesystem 
(HDFS/S3) for HFile reads. |
+| `BYTES_READ_FROM_FS`         | Bytes read from the filesystem — cold reads 
that missed every cache.    |
+| `BYTES_READ_FROM_MEMSTORE`   | Bytes read from memstore — un-flushed cells.  
                          |
+| `BYTES_READ_FROM_BLOCKCACHE` | Bytes served from the HBase block cache — 
warm reads.                   |
+| `BLOCK_READ_OPS_COUNT`       | Number of HFile block reads.                  
                          |
+| `RPC_SCAN_PROCESSING_TIME`   | Time (ms) the RegionServer spent processing 
the scan RPC.               |
+| `RPC_SCAN_QUEUE_WAIT_TIME`   | Time (ms) the scan RPC spent in the 
RegionServer's call queue.          |
+
+These are request-level metrics — they appear in the per-table map returned by
+`PhoenixRuntime.getRequestReadMetricInfo(rs)` alongside the existing entries:
+
+```java
+try (ResultSet rs = stmt.executeQuery(sql)) {
+    while (rs.next()) {
+        // ...
+    }
+    Map<String, Map<MetricType, Long>> readMetrics =
+            PhoenixRuntime.getRequestReadMetricInfo(rs);
+    long fsReadMs = readMetrics.get(tableName).get(MetricType.FS_READ_TIME);
+    long blocksRead = 
readMetrics.get(tableName).get(MetricType.BLOCK_READ_OPS_COUNT);
+    // ...
+}
+```
+
+They piggyback on `phoenix.trace.read.metrics.enabled` (the existing
+request-level metrics switch, on by default) and require no additional
+configuration. Values originate from HBase 2.6.3+; on older HBase versions

Review Comment:
   ```suggestion
   configuration. Values originate from HBase 2.6.4+; on older HBase versions
   ```



##########
app/pages/_docs/docs/_mdx/(multi-page)/features/metrics.mdx:
##########
@@ -117,3 +117,82 @@ service.submit(new Runnable() {
     }
 });
 ```
+
+## Scan latency metrics [#scan-latency-metrics]
+
+Phoenix 5.3.1 surfaces HBase's per-scan latency and IO metrics through the
+request-level metrics API, giving per-query visibility into where a scan
+actually spent its time
+([PHOENIX-7704](https://issues.apache.org/jira/browse/PHOENIX-7704)).
+
+| Metric                       | Description                                   
                          |
+| ---------------------------- | 
----------------------------------------------------------------------- |
+| `FS_READ_TIME`               | Time (ms) spent in the underlying filesystem 
(HDFS/S3) for HFile reads. |
+| `BYTES_READ_FROM_FS`         | Bytes read from the filesystem — cold reads 
that missed every cache.    |

Review Comment:
   ```suggestion
   | `BYTES_READ_FROM_FS`         | Bytes read from the filesystem — cold reads 
that missed HBase block cache.    |
   ```



##########
app/pages/_docs/docs/_mdx/(multi-page)/features/metrics.mdx:
##########
@@ -117,3 +117,82 @@ service.submit(new Runnable() {
     }
 });
 ```
+
+## Scan latency metrics [#scan-latency-metrics]
+
+Phoenix 5.3.1 surfaces HBase's per-scan latency and IO metrics through the
+request-level metrics API, giving per-query visibility into where a scan
+actually spent its time
+([PHOENIX-7704](https://issues.apache.org/jira/browse/PHOENIX-7704)).
+
+| Metric                       | Description                                   
                          |
+| ---------------------------- | 
----------------------------------------------------------------------- |
+| `FS_READ_TIME`               | Time (ms) spent in the underlying filesystem 
(HDFS/S3) for HFile reads. |
+| `BYTES_READ_FROM_FS`         | Bytes read from the filesystem — cold reads 
that missed every cache.    |
+| `BYTES_READ_FROM_MEMSTORE`   | Bytes read from memstore — un-flushed cells.  
                          |
+| `BYTES_READ_FROM_BLOCKCACHE` | Bytes served from the HBase block cache — 
warm reads.                   |
+| `BLOCK_READ_OPS_COUNT`       | Number of HFile block reads.                  
                          |
+| `RPC_SCAN_PROCESSING_TIME`   | Time (ms) the RegionServer spent processing 
the scan RPC.               |

Review Comment:
   ```suggestion
   | `RPC_SCAN_PROCESSING_TIME`   | Time (ms) the RegionServer spent processing 
the scan RPC in handler thread.               |
   ```



##########
app/pages/_docs/docs/_mdx/(multi-page)/features/metrics.mdx:
##########
@@ -117,3 +117,82 @@ service.submit(new Runnable() {
     }
 });
 ```
+
+## Scan latency metrics [#scan-latency-metrics]
+
+Phoenix 5.3.1 surfaces HBase's per-scan latency and IO metrics through the
+request-level metrics API, giving per-query visibility into where a scan
+actually spent its time
+([PHOENIX-7704](https://issues.apache.org/jira/browse/PHOENIX-7704)).
+
+| Metric                       | Description                                   
                          |
+| ---------------------------- | 
----------------------------------------------------------------------- |
+| `FS_READ_TIME`               | Time (ms) spent in the underlying filesystem 
(HDFS/S3) for HFile reads. |
+| `BYTES_READ_FROM_FS`         | Bytes read from the filesystem — cold reads 
that missed every cache.    |
+| `BYTES_READ_FROM_MEMSTORE`   | Bytes read from memstore — un-flushed cells.  
                          |
+| `BYTES_READ_FROM_BLOCKCACHE` | Bytes served from the HBase block cache — 
warm reads.                   |
+| `BLOCK_READ_OPS_COUNT`       | Number of HFile block reads.                  
                          |
+| `RPC_SCAN_PROCESSING_TIME`   | Time (ms) the RegionServer spent processing 
the scan RPC.               |
+| `RPC_SCAN_QUEUE_WAIT_TIME`   | Time (ms) the scan RPC spent in the 
RegionServer's call queue.          |
+
+These are request-level metrics — they appear in the per-table map returned by
+`PhoenixRuntime.getRequestReadMetricInfo(rs)` alongside the existing entries:
+
+```java
+try (ResultSet rs = stmt.executeQuery(sql)) {
+    while (rs.next()) {
+        // ...
+    }
+    Map<String, Map<MetricType, Long>> readMetrics =
+            PhoenixRuntime.getRequestReadMetricInfo(rs);
+    long fsReadMs = readMetrics.get(tableName).get(MetricType.FS_READ_TIME);
+    long blocksRead = 
readMetrics.get(tableName).get(MetricType.BLOCK_READ_OPS_COUNT);
+    // ...
+}
+```
+
+They piggyback on `phoenix.trace.read.metrics.enabled` (the existing
+request-level metrics switch, on by default) and require no additional
+configuration. Values originate from HBase 2.6.3+; on older HBase versions
+they are silently zero.
+
+## Top-N slowest parallel scans [#top-n-slowest-scans]
+
+For diagnosing tail-latency on a single statement, Phoenix can retain the

Review Comment:
   ```suggestion
   For diagnosing tail-latency on a single statement issuing multiple HBase 
scans, Phoenix can retain the
   ```



##########
app/pages/_docs/docs/_mdx/(multi-page)/features/metrics.mdx:
##########
@@ -117,3 +117,82 @@ service.submit(new Runnable() {
     }
 });
 ```
+
+## Scan latency metrics [#scan-latency-metrics]
+
+Phoenix 5.3.1 surfaces HBase's per-scan latency and IO metrics through the
+request-level metrics API, giving per-query visibility into where a scan
+actually spent its time
+([PHOENIX-7704](https://issues.apache.org/jira/browse/PHOENIX-7704)).
+
+| Metric                       | Description                                   
                          |
+| ---------------------------- | 
----------------------------------------------------------------------- |
+| `FS_READ_TIME`               | Time (ms) spent in the underlying filesystem 
(HDFS/S3) for HFile reads. |
+| `BYTES_READ_FROM_FS`         | Bytes read from the filesystem — cold reads 
that missed every cache.    |
+| `BYTES_READ_FROM_MEMSTORE`   | Bytes read from memstore — un-flushed cells.  
                          |
+| `BYTES_READ_FROM_BLOCKCACHE` | Bytes served from the HBase block cache — 
warm reads.                   |
+| `BLOCK_READ_OPS_COUNT`       | Number of HFile block reads.                  
                          |

Review Comment:
   ```suggestion
   | `BLOCK_READ_OPS_COUNT`       | Number of HFile blocks read from filesystem 
(HDFS/S3).                                            |
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to