dant3 commented on code in PR #7250: URL: https://github.com/apache/ignite-3/pull/7250#discussion_r2651394631
########## modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/checkpoint/CheckpointReadWriteLockMetrics.java: ########## @@ -0,0 +1,121 @@ +/* + * 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.ignite.internal.pagememory.persistence.checkpoint; + +import org.apache.ignite.internal.metrics.DistributionMetric; +import org.apache.ignite.internal.metrics.LongAdderMetric; + +/** + * Metrics for checkpoint read/write lock operations. + * + * <p>This metric source tracks performance and contention characteristics of checkpoint read locks + * acquired by normal operations during database operation. These locks coordinate with the checkpoint + * write lock to ensure consistency. + */ +public class CheckpointReadWriteLockMetrics { + private static final long[] LOCK_ACQUISITION_NANOS = { + 1_000, // 1µs - uncontended, fast path + 10_000, // 10µs - minor contention + 100_000, // 100µs - moderate contention + 1_000_000, // 1ms - high contention + 10_000_000, // 10ms - checkpoint in progress? + 100_000_000, // 100ms - severe contention, reported as warning in logs + 1_000_000_000 // 1s - pathological case, shall be treated as an emergency error Review Comment: My own judgement. Suggestions on this matter are welcome. -- 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]
