zentol commented on a change in pull request #14526: URL: https://github.com/apache/flink/pull/14526#discussion_r551508508
########## File path: flink-runtime/src/main/java/org/apache/flink/runtime/metrics/groups/TimeGauge.java ########## @@ -0,0 +1,80 @@ +/* + * 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. + */ + +// ---------------------------------------------------------------------------- +// This class is largely adapted from "com.google.common.base.Preconditions", +// which is part of the "Guava" library. +// +// Because of frequent issues with dependency conflicts, this class was +// added to the Flink code base to reduce dependency on Guava. +// ---------------------------------------------------------------------------- + +package org.apache.flink.runtime.metrics.groups; + +import org.apache.flink.annotation.VisibleForTesting; +import org.apache.flink.metrics.Gauge; +import org.apache.flink.metrics.View; + +/** + * {@link TimeGauge} encapsulate logic of measuring time rates (like idleTime ms/s). In particularly Review comment: hmm......well we wouldn't necessarily have to _change_ the API in that sense; should be possible to do this in a backwards-compatible way. We could expose these as `(idle|backpressure|busy)Ratio` with the value being between `[0.000, 1.000]`, and also under the old name(s) with the value multiplied by 1000? The main benefit I see is that this is quite generic and independent of specific units; we can have other metrics doing rates over minutes yet still work the same value range. So it's a bit of future proofing. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected]
