anmolanmol1234 commented on code in PR #8611: URL: https://github.com/apache/hadoop/pull/8611#discussion_r3842995439
########## hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/TestPhotonListBlobMetrics.java: ########## @@ -0,0 +1,95 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.fs.azurebfs; + +import java.net.URI; +import java.util.Map; + +import org.junit.jupiter.api.Test; + +import org.apache.hadoop.fs.azurebfs.services.AbfsCounters; +import org.apache.hadoop.fs.statistics.DurationTracker; + +import static org.apache.hadoop.fs.azurebfs.AbfsStatistic.PHOTON_FALLBACK_COUNT; +import static org.apache.hadoop.fs.azurebfs.AbfsStatistic.PHOTON_LISTING_LATENCY; +import static org.apache.hadoop.fs.azurebfs.AbfsStatistic.PHOTON_PARSE_FAILURE_COUNT; +import static org.apache.hadoop.fs.azurebfs.AbfsStatistic.PHOTON_REQUEST_COUNT; +import static org.apache.hadoop.fs.azurebfs.AbfsStatistic.PHOTON_RESPONSE_COUNT; +import static org.assertj.core.api.Assertions.assertThat; + +/** + * Unit tests verifying that the Photon (Apache Arrow based ListBlob) telemetry + * counters and the listing latency duration tracker are registered on the ABFS + * counters instance and can be incremented / tracked. + */ +public class TestPhotonListBlobMetrics { Review Comment: This file only proves the metrics framework works — that incrementCounter increments. None of the actual Photon logic is tested: updatePhotonResponseMetrics() skipping non-200 responses, updatePhotonParseFailureMetric() firing only when the response was Arrow, and the extra updatePhotonRequestMetric() on the rename-recovery retry. Those three rules are the ones that make the rollout dashboard trustworthy and they have zero unit coverage. Please add tests for them (a mocked AbfsHttpOperation with a given status code and Content-Type is enough) -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
