[jira] [Commented] (FLINK-6053) Gauge should only take subclasses of Number, rather than everything

2019-10-04 Thread Chesnay Schepler (Jira)


[ 
https://issues.apache.org/jira/browse/FLINK-6053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=1697#comment-1697
 ] 

Chesnay Schepler commented on FLINK-6053:
-

Still valid, just haven't had the time to finalize the PR as it is quite a low 
priority task.

> Gauge should only take subclasses of Number, rather than everything
> --
>
> Key: FLINK-6053
> URL: https://issues.apache.org/jira/browse/FLINK-6053
> Project: Flink
>  Issue Type: Improvement
>  Components: Runtime / Metrics
>Affects Versions: 1.2.0
>Reporter: Bowen Li
>Assignee: Chesnay Schepler
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Currently, Flink's Gauge is defined as 
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```
> But it doesn't make sense to have Gauge take generic types other than Number. 
> And it blocks I from finishing FLINK-6013, because I cannot assume Gauge is 
> only about Number. So the class should be like
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (FLINK-6053) Gauge should only take subclasses of Number, rather than everything

2019-09-27 Thread Till Rohrmann (Jira)


[ 
https://issues.apache.org/jira/browse/FLINK-6053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16939264#comment-16939264
 ] 

Till Rohrmann commented on FLINK-6053:
--

What is the state of this issue [~Zentol]? Is it still valid? If not, then 
please close.

> Gauge should only take subclasses of Number, rather than everything
> --
>
> Key: FLINK-6053
> URL: https://issues.apache.org/jira/browse/FLINK-6053
> Project: Flink
>  Issue Type: Improvement
>  Components: Runtime / Metrics
>Affects Versions: 1.2.0
>Reporter: Bowen Li
>Assignee: Chesnay Schepler
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Currently, Flink's Gauge is defined as 
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```
> But it doesn't make sense to have Gauge take generic types other than Number. 
> And it blocks I from finishing FLINK-6013, because I cannot assume Gauge is 
> only about Number. So the class should be like
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (FLINK-6053) Gauge should only take subclasses of Number, rather than everything

2018-03-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-6053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16391225#comment-16391225
 ] 

ASF GitHub Bot commented on FLINK-6053:
---

Github user StephanEwen commented on a diff in the pull request:

https://github.com/apache/flink/pull/5501#discussion_r173150593
  
--- Diff: 
flink-scala/src/main/scala/org/apache/flink/api/scala/metrics/ScalaGauge.scala 
---
@@ -23,6 +23,7 @@ import org.apache.flink.metrics.Gauge
 /**
   * This class allows the concise definition of a gauge from Scala using 
function references.
   */
+@deprecated("use NumberGauge or StringGauge instead")
--- End diff --

Would be good to add a `ScalaStringGauge` and a `ScalaNumericGauge`.


> Gauge should only take subclasses of Number, rather than everything
> --
>
> Key: FLINK-6053
> URL: https://issues.apache.org/jira/browse/FLINK-6053
> Project: Flink
>  Issue Type: Improvement
>  Components: Metrics
>Affects Versions: 1.2.0
>Reporter: Bowen Li
>Assignee: Chesnay Schepler
>Priority: Major
> Fix For: 1.6.0
>
>
> Currently, Flink's Gauge is defined as 
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```
> But it doesn't make sense to have Gauge take generic types other than Number. 
> And it blocks I from finishing FLINK-6013, because I cannot assume Gauge is 
> only about Number. So the class should be like
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-6053) Gauge should only take subclasses of Number, rather than everything

2018-03-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-6053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16391226#comment-16391226
 ] 

ASF GitHub Bot commented on FLINK-6053:
---

Github user StephanEwen commented on a diff in the pull request:

https://github.com/apache/flink/pull/5501#discussion_r173148163
  
--- Diff: 
flink-metrics/flink-metrics-core/src/main/java/org/apache/flink/metrics/MetricGroup.java
 ---
@@ -87,9 +89,27 @@
 * @param gauge gauge to register
 * @paramreturn type of the gauge
 * @return the given gauge
+* @deprecated use {@link #register(String, NumberGauge)} or {@link 
#register(String, StringGauge)} instead
 */
+   @Deprecated
> G gauge(String name, G gauge);
 
+   /**
+* Registers a new {@link org.apache.flink.metrics.NumberGauge} with 
Flink.
--- End diff --

Minor: You don't need the fully qualified class name, the JavaDocs actually 
read easier with just the class names.


> Gauge should only take subclasses of Number, rather than everything
> --
>
> Key: FLINK-6053
> URL: https://issues.apache.org/jira/browse/FLINK-6053
> Project: Flink
>  Issue Type: Improvement
>  Components: Metrics
>Affects Versions: 1.2.0
>Reporter: Bowen Li
>Assignee: Chesnay Schepler
>Priority: Major
> Fix For: 1.6.0
>
>
> Currently, Flink's Gauge is defined as 
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```
> But it doesn't make sense to have Gauge take generic types other than Number. 
> And it blocks I from finishing FLINK-6013, because I cannot assume Gauge is 
> only about Number. So the class should be like
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-6053) Gauge should only take subclasses of Number, rather than everything

2018-03-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-6053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16391224#comment-16391224
 ] 

ASF GitHub Bot commented on FLINK-6053:
---

Github user StephanEwen commented on a diff in the pull request:

https://github.com/apache/flink/pull/5501#discussion_r173149289
  
--- Diff: 
flink-metrics/flink-metrics-core/src/main/java/org/apache/flink/metrics/reporter/AbstractReporterV2.java
 ---
@@ -0,0 +1,89 @@
+/*
+ * 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.flink.metrics.reporter;
+
+import org.apache.flink.metrics.CharacterFilter;
+import org.apache.flink.metrics.Counter;
+import org.apache.flink.metrics.Histogram;
+import org.apache.flink.metrics.Meter;
+import org.apache.flink.metrics.Metric;
+import org.apache.flink.metrics.MetricGroup;
+import org.apache.flink.metrics.NumberGauge;
+import org.apache.flink.metrics.StringGauge;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Base interface for custom metric reporters.
+ */
+public abstract class AbstractReporterV2 implements MetricReporter, 
CharacterFilter {
+   protected final Logger log = LoggerFactory.getLogger(getClass());
+
+   protected final Map stringGauges = new HashMap<>();
+   protected final Map numberGauges = new HashMap<>();
+   protected final Map counters = new HashMap<>();
+   protected final Map histograms = new HashMap<>();
+   protected final Map meters = new HashMap<>();
+
+   @Override
+   public void notifyOfAddedMetric(Metric metric, String metricName, 
MetricGroup group) {
+   final String name = group.getMetricIdentifier(metricName, this);
+
+   synchronized (this) {
--- End diff --

Minor: It is good practice to not lock on `this` for strictly internal 
mutual exclusion, because someone from the outside can lock on the same object 
- it is outside the class's control. Having a dedicated lock object instead is 
the recommendation.


> Gauge should only take subclasses of Number, rather than everything
> --
>
> Key: FLINK-6053
> URL: https://issues.apache.org/jira/browse/FLINK-6053
> Project: Flink
>  Issue Type: Improvement
>  Components: Metrics
>Affects Versions: 1.2.0
>Reporter: Bowen Li
>Assignee: Chesnay Schepler
>Priority: Major
> Fix For: 1.6.0
>
>
> Currently, Flink's Gauge is defined as 
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```
> But it doesn't make sense to have Gauge take generic types other than Number. 
> And it blocks I from finishing FLINK-6013, because I cannot assume Gauge is 
> only about Number. So the class should be like
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-6053) Gauge should only take subclasses of Number, rather than everything

2018-03-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-6053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16391200#comment-16391200
 ] 

ASF GitHub Bot commented on FLINK-6053:
---

Github user StephanEwen commented on a diff in the pull request:

https://github.com/apache/flink/pull/5501#discussion_r173146558
  
--- Diff: 
flink-metrics/flink-metrics-core/src/main/java/org/apache/flink/metrics/StringGauge.java
 ---
@@ -0,0 +1,26 @@
+/*
+ * 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.flink.metrics;
+
+/**
+ * A StringGauge is a {@link Metric} that calculates a specific {@link 
String} value at a point in time.
+ */
+public interface StringGauge extends Metric {
--- End diff --

Should be annotated with `@FunctionalInterface` to guard that this always 
stays lambda-able.

Also annotate with Public / PublicEvolving?


> Gauge should only take subclasses of Number, rather than everything
> --
>
> Key: FLINK-6053
> URL: https://issues.apache.org/jira/browse/FLINK-6053
> Project: Flink
>  Issue Type: Improvement
>  Components: Metrics
>Affects Versions: 1.2.0
>Reporter: Bowen Li
>Assignee: Chesnay Schepler
>Priority: Major
> Fix For: 1.6.0
>
>
> Currently, Flink's Gauge is defined as 
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```
> But it doesn't make sense to have Gauge take generic types other than Number. 
> And it blocks I from finishing FLINK-6013, because I cannot assume Gauge is 
> only about Number. So the class should be like
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-6053) Gauge should only take subclasses of Number, rather than everything

2018-03-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-6053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16391198#comment-16391198
 ] 

ASF GitHub Bot commented on FLINK-6053:
---

Github user StephanEwen commented on a diff in the pull request:

https://github.com/apache/flink/pull/5501#discussion_r173146108
  
--- Diff: 
flink-metrics/flink-metrics-core/src/main/java/org/apache/flink/metrics/NumberGauge.java
 ---
@@ -0,0 +1,26 @@
+/*
+ * 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.flink.metrics;
+
+/**
+ * A NumberGauge is a {@link Metric} that calculates a specific {@link 
Number} value at a point in time.
+ */
+public interface NumberGauge extends Metric {
--- End diff --

This could be generic, as in
```java
public interface NumberGauge extends Metric {
T getNumberValue();
}
```
Was there a specific reason to not make this generic?


> Gauge should only take subclasses of Number, rather than everything
> --
>
> Key: FLINK-6053
> URL: https://issues.apache.org/jira/browse/FLINK-6053
> Project: Flink
>  Issue Type: Improvement
>  Components: Metrics
>Affects Versions: 1.2.0
>Reporter: Bowen Li
>Assignee: Chesnay Schepler
>Priority: Major
> Fix For: 1.6.0
>
>
> Currently, Flink's Gauge is defined as 
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```
> But it doesn't make sense to have Gauge take generic types other than Number. 
> And it blocks I from finishing FLINK-6013, because I cannot assume Gauge is 
> only about Number. So the class should be like
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-6053) Gauge should only take subclasses of Number, rather than everything

2018-03-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-6053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16391201#comment-16391201
 ] 

ASF GitHub Bot commented on FLINK-6053:
---

Github user StephanEwen commented on a diff in the pull request:

https://github.com/apache/flink/pull/5501#discussion_r173147513
  
--- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/metrics/groups/AbstractMetricGroup.java
 ---
@@ -460,4 +474,77 @@ protected GenericMetricGroup createChildGroup(String 
name, ChildType childType)
VALUE,
GENERIC
}
+
+   /**
+* This class wraps a legacy {@link Gauge} to ensure that legacy 
metrics are not ignored by reporters that only work
+* against the {@link StringGauge} and {@link NumberGauge} interfaces.
+*
+* @param  type of the gauge
+*/
+   private static class LegacyGaugeWrapper implements StringGauge, 
Gauge {
+   private final Gauge legacyGauge;
+
+   private LegacyGaugeWrapper(Gauge legacyGauge) {
+   this.legacyGauge = legacyGauge;
+   }
+
+   @Override
+   public String getStringValue() {
+   T value = legacyGauge.getValue();
--- End diff --

Do we actually want/support Gauges that return null? Or should they return 
"(null)", so that downstream code can assume non-null values?

If we always want non null values, you can use `return 
String.valueOf(legacyGauge.getValue())`.

Otherwise, all methods should be annotated with `@Nullable`.


> Gauge should only take subclasses of Number, rather than everything
> --
>
> Key: FLINK-6053
> URL: https://issues.apache.org/jira/browse/FLINK-6053
> Project: Flink
>  Issue Type: Improvement
>  Components: Metrics
>Affects Versions: 1.2.0
>Reporter: Bowen Li
>Assignee: Chesnay Schepler
>Priority: Major
> Fix For: 1.6.0
>
>
> Currently, Flink's Gauge is defined as 
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```
> But it doesn't make sense to have Gauge take generic types other than Number. 
> And it blocks I from finishing FLINK-6013, because I cannot assume Gauge is 
> only about Number. So the class should be like
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-6053) Gauge should only take subclasses of Number, rather than everything

2018-03-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-6053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16391199#comment-16391199
 ] 

ASF GitHub Bot commented on FLINK-6053:
---

Github user StephanEwen commented on a diff in the pull request:

https://github.com/apache/flink/pull/5501#discussion_r173146575
  
--- Diff: 
flink-metrics/flink-metrics-core/src/main/java/org/apache/flink/metrics/NumberGauge.java
 ---
@@ -0,0 +1,26 @@
+/*
+ * 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.flink.metrics;
+
+/**
+ * A NumberGauge is a {@link Metric} that calculates a specific {@link 
Number} value at a point in time.
+ */
+public interface NumberGauge extends Metric {
--- End diff --

Should be annotated with `@FunctionalInterface` to guard that this always 
stays lambda-able.

Also annotate with Public / PublicEvolving?


> Gauge should only take subclasses of Number, rather than everything
> --
>
> Key: FLINK-6053
> URL: https://issues.apache.org/jira/browse/FLINK-6053
> Project: Flink
>  Issue Type: Improvement
>  Components: Metrics
>Affects Versions: 1.2.0
>Reporter: Bowen Li
>Assignee: Chesnay Schepler
>Priority: Major
> Fix For: 1.6.0
>
>
> Currently, Flink's Gauge is defined as 
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```
> But it doesn't make sense to have Gauge take generic types other than Number. 
> And it blocks I from finishing FLINK-6013, because I cannot assume Gauge is 
> only about Number. So the class should be like
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-6053) Gauge should only take subclasses of Number, rather than everything

2018-03-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-6053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16388293#comment-16388293
 ] 

ASF GitHub Bot commented on FLINK-6053:
---

Github user bowenli86 commented on the issue:

https://github.com/apache/flink/pull/5501
  
LGTM, +1 on merging to 1.6.0


> Gauge should only take subclasses of Number, rather than everything
> --
>
> Key: FLINK-6053
> URL: https://issues.apache.org/jira/browse/FLINK-6053
> Project: Flink
>  Issue Type: Improvement
>  Components: Metrics
>Affects Versions: 1.2.0
>Reporter: Bowen Li
>Assignee: Chesnay Schepler
>Priority: Major
> Fix For: 1.6.0
>
>
> Currently, Flink's Gauge is defined as 
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```
> But it doesn't make sense to have Gauge take generic types other than Number. 
> And it blocks I from finishing FLINK-6013, because I cannot assume Gauge is 
> only about Number. So the class should be like
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-6053) Gauge should only take subclasses of Number, rather than everything

2018-02-20 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-6053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16369905#comment-16369905
 ] 

ASF GitHub Bot commented on FLINK-6053:
---

Github user StephanEwen commented on the issue:

https://github.com/apache/flink/pull/5501
  
Thanks, makes sense!


> Gauge should only take subclasses of Number, rather than everything
> --
>
> Key: FLINK-6053
> URL: https://issues.apache.org/jira/browse/FLINK-6053
> Project: Flink
>  Issue Type: Improvement
>  Components: Metrics
>Affects Versions: 1.2.0
>Reporter: Bowen Li
>Assignee: Chesnay Schepler
>Priority: Major
> Fix For: 1.5.0
>
>
> Currently, Flink's Gauge is defined as 
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```
> But it doesn't make sense to have Gauge take generic types other than Number. 
> And it blocks I from finishing FLINK-6013, because I cannot assume Gauge is 
> only about Number. So the class should be like
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-6053) Gauge should only take subclasses of Number, rather than everything

2018-02-20 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-6053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16369870#comment-16369870
 ] 

ASF GitHub Bot commented on FLINK-6053:
---

Github user zentol commented on the issue:

https://github.com/apache/flink/pull/5501
  
They are not registered twice. For gauges we create Wrapper that would, for 
a `Gauge`, implements both `Gauge` and `StringGauge`.

Legacy reporters would go through the Gauge interface and behave as they 
always did, reporter going through the `StringGauge` interface would stringify 
whatever the gauge returns.

Similarly, the new gauge types are wrapped so that we register something 
that implements both `Gauge` and `String-/NumberGauge`.

see `AbstractMetricGroup`:
```
public > G gauge(int name, G gauge) {
return gauge(String.valueOf(name), gauge);
}

public > G gauge(String name, G gauge) {
addMetric(name, new LegacyGaugeWrapper<>(gauge));
return gauge;
}

public void register(String name, StringGauge gauge) {
addMetric(name, new StringGaugeWrapper(gauge));
}

@Override
public void register(String name, NumberGauge gauge) {
addMetric(name, new NumberGaugeWrapper(gauge));
}

private static class LegacyGaugeWrapper implements StringGauge, 
Gauge {
private final Gauge legacyGauge;

private LegacyGaugeWrapper(Gauge legacyGauge) {
this.legacyGauge = legacyGauge;
}

@Override
public String getStringValue() {
T value = legacyGauge.getValue();
if (value == null) {
return null;
} else {
return value.toString();
}
}

@Override
public T getValue() {
return legacyGauge.getValue();
}
}
```



> Gauge should only take subclasses of Number, rather than everything
> --
>
> Key: FLINK-6053
> URL: https://issues.apache.org/jira/browse/FLINK-6053
> Project: Flink
>  Issue Type: Improvement
>  Components: Metrics
>Affects Versions: 1.2.0
>Reporter: Bowen Li
>Assignee: Chesnay Schepler
>Priority: Major
> Fix For: 1.5.0
>
>
> Currently, Flink's Gauge is defined as 
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```
> But it doesn't make sense to have Gauge take generic types other than Number. 
> And it blocks I from finishing FLINK-6013, because I cannot assume Gauge is 
> only about Number. So the class should be like
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-6053) Gauge should only take subclasses of Number, rather than everything

2018-02-20 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-6053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16369859#comment-16369859
 ] 

ASF GitHub Bot commented on FLINK-6053:
---

Github user StephanEwen commented on the issue:

https://github.com/apache/flink/pull/5501
  
If I understand correctly, all Gauges are now registered twice? Could we 
just register them once and map `Gauge` always to a `StringGauge` calling 
`Objects.toString()` on its value?


> Gauge should only take subclasses of Number, rather than everything
> --
>
> Key: FLINK-6053
> URL: https://issues.apache.org/jira/browse/FLINK-6053
> Project: Flink
>  Issue Type: Improvement
>  Components: Metrics
>Affects Versions: 1.2.0
>Reporter: Bowen Li
>Assignee: Chesnay Schepler
>Priority: Major
> Fix For: 1.5.0
>
>
> Currently, Flink's Gauge is defined as 
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```
> But it doesn't make sense to have Gauge take generic types other than Number. 
> And it blocks I from finishing FLINK-6013, because I cannot assume Gauge is 
> only about Number. So the class should be like
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-6053) Gauge should only take subclasses of Number, rather than everything

2018-02-17 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-6053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16368140#comment-16368140
 ] 

ASF GitHub Bot commented on FLINK-6053:
---

Github user zentol commented on the issue:

https://github.com/apache/flink/pull/5501
  
Yeah I'm not happy that we now added another instanceof clause.

Ultimately we could modify `Counter` and `Meter` to implement `NumberGauge` 
(returning the count and rate, respectively), but that still leaves us with 3 
metric types (StringGauge, NumberGauge, Histogram).
(Long-term i would still like to throw out StringGauges, or force reporters 
to implement a dedicated interface)

We could also hide histograms behind a series of `NumberGauges`, but it is 
difficult to ensure that all gauges refer to the same `HistogramStatistics`, 
i.e. are consistent as a whole, as they do currently.

I didn't do anything in that regard in this PR as it would change behavior 
of some reporters that try to map our types to whatever types the backend uses. 
But this is very problematic anyway as our metric types are mostly syntactic 
sugar; the choice between counter/gauge is rather arbitrary.



> Gauge should only take subclasses of Number, rather than everything
> --
>
> Key: FLINK-6053
> URL: https://issues.apache.org/jira/browse/FLINK-6053
> Project: Flink
>  Issue Type: Improvement
>  Components: Metrics
>Affects Versions: 1.2.0
>Reporter: Bowen Li
>Assignee: Chesnay Schepler
>Priority: Major
> Fix For: 1.5.0
>
>
> Currently, Flink's Gauge is defined as 
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```
> But it doesn't make sense to have Gauge take generic types other than Number. 
> And it blocks I from finishing FLINK-6013, because I cannot assume Gauge is 
> only about Number. So the class should be like
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-6053) Gauge should only take subclasses of Number, rather than everything

2018-02-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-6053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16367997#comment-16367997
 ] 

ASF GitHub Bot commented on FLINK-6053:
---

Github user bowenli86 commented on the issue:

https://github.com/apache/flink/pull/5501
  
LGTM generally.

I still feel having all the `instanceof` in `notifyOfAddedMetric` and 
`notifyOfRemovedMetric` is a bit inelegant. I'm fine with it since there'll 
(hopefully) be only a limited number of metric types, so the `instanceof` 
clauses won't grow insanely.




> Gauge should only take subclasses of Number, rather than everything
> --
>
> Key: FLINK-6053
> URL: https://issues.apache.org/jira/browse/FLINK-6053
> Project: Flink
>  Issue Type: Improvement
>  Components: Metrics
>Affects Versions: 1.2.0
>Reporter: Bowen Li
>Assignee: Chesnay Schepler
>Priority: Major
> Fix For: 1.5.0
>
>
> Currently, Flink's Gauge is defined as 
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```
> But it doesn't make sense to have Gauge take generic types other than Number. 
> And it blocks I from finishing FLINK-6013, because I cannot assume Gauge is 
> only about Number. So the class should be like
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-6053) Gauge should only take subclasses of Number, rather than everything

2018-02-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-6053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16366710#comment-16366710
 ] 

ASF GitHub Bot commented on FLINK-6053:
---

GitHub user zentol opened a pull request:

https://github.com/apache/flink/pull/5501

[FLINK-6053][metrics] Add new Number-/StringGauge metric types

## What is the purpose of the change

This PR deprecates the `Gauge` metric type and introduces 2 new metric 
types: `StringGauge` and `NumberGauge`. The generic nature of `Gauges` is a big 
headache as it encourages exposing arbitrary objects, which not a single 
reporter actually supports. Furthermore, making the type distinction also 
proved to be difficult, as gauges may return null which fails `instanceof` 
checks.

This change is for the most part backwards compatible:
* `StringGauges` are wrapped such that they are registered as both 
`Gauge` and `StringGauge`
* `NumberGauges` are wrapped such that they are registered as both 
`Gauge` and `NumberGauge`
* `Gauges` are wrapper such that they are registered as both `Gauge` 
and `StringGauge`.

Thus, legacy reporters still work with the new metric types, and old 
metrics still work with new reporters, provided the reporter supports strings. 
We _could_ improve the compatibility for old metrics by checking the return 
type of the gauge for whether it is a number and register a `NumberGauge` 
instead.

A new overloaded method `void register` was added to `MetricGroup`. We 
could not overload `gauge()` as this would forbid lambdas from being used 
without explicit class declaration.
The signature of `register` is different than other registration methods. 
Neither do they return the given metric nor do they have generic parameters. 
This is done to support lambdas, as they have inherent problems with generic 
methods (ambiguity). This change has no effect on our code-base as we nowhere 
made use of this feature (which i think is still neat).

The first commit introduces the new types, deprecates Gauges and sets up 
the compatibility layer.
The second commit updates all reporters to work against the new metric 
types.
The third commit replaces all existing usages of `Gauges` to instead use 
the new metric types.

## Verifying this change

Existing tests were updated.

## Does this pull request potentially affect one of the following parts:

  - Dependencies (does it add or upgrade a dependency): (no)
  - The public API, i.e., is any changed class annotated with 
`@Public(Evolving)`: (yes)
  - The serializers: (no)
  - The runtime per-record code paths (performance sensitive): (no)
  - Anything that affects deployment or recovery: JobManager (and its 
components), Checkpointing, Yarn/Mesos, ZooKeeper: (no)
  - The S3 file system connector: (no)

## Documentation

The documentation was not updated yet.


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/zentol/flink 6053

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/flink/pull/5501.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #5501


commit 7bc13f9f8dcb814fa88b746c1839511a639b234e
Author: zentol 
Date:   2018-02-07T10:11:56Z

[FLINK-6053][metrics] Add new Number-/StringGauge metric types

commit 85a48c02fbd58edc822949cf9f9177c9c36661cc
Author: zentol 
Date:   2018-02-07T10:34:50Z

update reporters

commit 2046d3ee79adeb0528169686c3fddf980232614d
Author: zentol 
Date:   2018-02-14T14:26:04Z

replace all usages of now deprecated Gauge




> Gauge should only take subclasses of Number, rather than everything
> --
>
> Key: FLINK-6053
> URL: https://issues.apache.org/jira/browse/FLINK-6053
> Project: Flink
>  Issue Type: Improvement
>  Components: Metrics
>Affects Versions: 1.2.0
>Reporter: Bowen Li
>Assignee: Chesnay Schepler
>Priority: Major
> Fix For: 1.5.0
>
>
> Currently, Flink's Gauge is defined as 
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```
> But it doesn't make sense to have Gauge take generic types other than Number. 
> And it blocks I from finishing FLINK-6013, because I cannot assume Gauge is 
> only about Number. So the class should be like
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-6053) Gauge should only take subclasses of Number, rather than everything

2017-11-28 Thread Chesnay Schepler (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-6053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16269508#comment-16269508
 ] 

Chesnay Schepler commented on FLINK-6053:
-

We can't properly subsume the existing gauge type until the Histogram was 
reworked. Once that is done, we will deprecate the freestyle gauge type and 
introduce new String-/NumberGauge types.

> Gauge should only take subclasses of Number, rather than everything
> --
>
> Key: FLINK-6053
> URL: https://issues.apache.org/jira/browse/FLINK-6053
> Project: Flink
>  Issue Type: Improvement
>  Components: Metrics
>Affects Versions: 1.2.0
>Reporter: Bowen Li
> Fix For: 2.0.0
>
>
> Currently, Flink's Gauge is defined as 
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```
> But it doesn't make sense to have Gauge take generic types other than Number. 
> And it blocks I from finishing FLINK-6013, because I cannot assume Gauge is 
> only about Number. So the class should be like
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (FLINK-6053) Gauge should only take subclasses of Number, rather than everything

2017-03-16 Thread Bowen Li (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-6053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15928381#comment-15928381
 ] 

Bowen Li commented on FLINK-6053:
-

Thank you!

> Gauge should only take subclasses of Number, rather than everything
> --
>
> Key: FLINK-6053
> URL: https://issues.apache.org/jira/browse/FLINK-6053
> Project: Flink
>  Issue Type: Improvement
>  Components: Metrics
>Affects Versions: 1.2.0
>Reporter: Bowen Li
> Fix For: 2.0.0
>
>
> Currently, Flink's Gauge is defined as 
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```
> But it doesn't make sense to have Gauge take generic types other than Number. 
> And it blocks I from finishing FLINK-6013, because I cannot assume Gauge is 
> only about Number. So the class should be like
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (FLINK-6053) Gauge should only take subclasses of Number, rather than everything

2017-03-16 Thread Chesnay Schepler (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-6053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15927797#comment-15927797
 ] 

Chesnay Schepler commented on FLINK-6053:
-

[~phoenixjiangnan] You now have contributor permissions.

> Gauge should only take subclasses of Number, rather than everything
> --
>
> Key: FLINK-6053
> URL: https://issues.apache.org/jira/browse/FLINK-6053
> Project: Flink
>  Issue Type: Improvement
>  Components: Metrics
>Affects Versions: 1.2.0
>Reporter: Bowen Li
> Fix For: 2.0.0
>
>
> Currently, Flink's Gauge is defined as 
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```
> But it doesn't make sense to have Gauge take generic types other than Number. 
> And it blocks I from finishing FLINK-6013, because I cannot assume Gauge is 
> only about Number. So the class should be like
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (FLINK-6053) Gauge should only take subclasses of Number, rather than everything

2017-03-15 Thread Bowen Li (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-6053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15926665#comment-15926665
 ] 

Bowen Li commented on FLINK-6053:
-

Cool. Adding a NumberGauge or NumericGauge was my first impression when running 
into this problem. But not being able to extend AbstractReporter might not be 
good. I need more time to think through solution. And I appreciate your input!

BTW, can you please add me as contributor to this project, so I can assign 
tickets to myself?

> Gauge should only take subclasses of Number, rather than everything
> --
>
> Key: FLINK-6053
> URL: https://issues.apache.org/jira/browse/FLINK-6053
> Project: Flink
>  Issue Type: Improvement
>  Components: Metrics
>Affects Versions: 1.2.0
>Reporter: Bowen Li
> Fix For: 2.0.0
>
>
> Currently, Flink's Gauge is defined as 
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```
> But it doesn't make sense to have Gauge take generic types other than Number. 
> And it blocks I from finishing FLINK-6013, because I cannot assume Gauge is 
> only about Number. So the class should be like
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (FLINK-6053) Gauge should only take subclasses of Number, rather than everything

2017-03-15 Thread Chesnay Schepler (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-6053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15926574#comment-15926574
 ] 

Chesnay Schepler commented on FLINK-6053:
-

Actually we could change the AbstractReporter but it would be really hacky. We 
would have to gauges Map that contains all gauges, add a separate map for 
numberGauges, and another map for non-Number gauges. (All gauges for legacy 
reporters, the other 2 maps for new reporters).

> Gauge should only take subclasses of Number, rather than everything
> --
>
> Key: FLINK-6053
> URL: https://issues.apache.org/jira/browse/FLINK-6053
> Project: Flink
>  Issue Type: Improvement
>  Components: Metrics
>Affects Versions: 1.2.0
>Reporter: Bowen Li
> Fix For: 2.0.0
>
>
> Currently, Flink's Gauge is defined as 
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```
> But it doesn't make sense to have Gauge take generic types other than Number. 
> And it blocks I from finishing FLINK-6013, because I cannot assume Gauge is 
> only about Number. So the class should be like
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (FLINK-6053) Gauge should only take subclasses of Number, rather than everything

2017-03-15 Thread Chesnay Schepler (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-6053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15926561#comment-15926561
 ] 

Chesnay Schepler commented on FLINK-6053:
-

I can see the merit and would be in favor of doing that; i do consider the 
current Gauge definition a mistake. But we would first need a plan on what to 
do with the existing metrics that rely on the current interface.

What we could right now though is the following:

Step 1:
Add a new class:
{code:java}
class NumberGauge extends Gauge {
}
{code}

Step 2:
Migrate all existing gauges that return numbers to this class.

Step 3:
You can now check for instanceof NumberGauge in the reporter, similar to other 
metrics. Since we have to make instanceof checks anyway (because FLINK-5095 is 
still open)
this shouldn't be s terrible.

This does not break the API since all reporters that are unaware of this new 
type will simply handle it as a gauge.
Note that a reporter that wants to use this must not extend AbstractReporter 
since we can't change that class to account for this new type.

> Gauge should only take subclasses of Number, rather than everything
> --
>
> Key: FLINK-6053
> URL: https://issues.apache.org/jira/browse/FLINK-6053
> Project: Flink
>  Issue Type: Improvement
>  Components: Metrics
>Affects Versions: 1.2.0
>Reporter: Bowen Li
> Fix For: 2.0.0
>
>
> Currently, Flink's Gauge is defined as 
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```
> But it doesn't make sense to have Gauge take generic types other than Number. 
> And it blocks I from finishing FLINK-6013, because I cannot assume Gauge is 
> only about Number. So the class should be like
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (FLINK-6053) Gauge should only take subclasses of Number, rather than everything

2017-03-15 Thread Bowen Li (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-6053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15926514#comment-15926514
 ] 

Bowen Li commented on FLINK-6053:
-

I see. I can do a hack in FLINK-6013 to check if a Gauge is typed as Number 
before sending it as a datadog metric.

Do you still feel it's necessary to make this change? If not, I can close this 
issue.

> Gauge should only take subclasses of Number, rather than everything
> --
>
> Key: FLINK-6053
> URL: https://issues.apache.org/jira/browse/FLINK-6053
> Project: Flink
>  Issue Type: Improvement
>  Components: Metrics
>Affects Versions: 1.2.0
>Reporter: Bowen Li
> Fix For: 2.0.0
>
>
> Currently, Flink's Gauge is defined as 
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```
> But it doesn't make sense to have Gauge take generic types other than Number. 
> And it blocks I from finishing FLINK-6013, because I cannot assume Gauge is 
> only about Number. So the class should be like
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (FLINK-6053) Gauge should only take subclasses of Number, rather than everything

2017-03-15 Thread Chesnay Schepler (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-6053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15925915#comment-15925915
 ] 

Chesnay Schepler commented on FLINK-6053:
-

This would break a public API so we can only do it for 2.0.

Also, the latency metric is also implemented as a Gauge which returns a HashMap.

> Gauge should only take subclasses of Number, rather than everything
> --
>
> Key: FLINK-6053
> URL: https://issues.apache.org/jira/browse/FLINK-6053
> Project: Flink
>  Issue Type: Improvement
>  Components: Metrics
>Affects Versions: 1.2.0
>Reporter: Bowen Li
> Fix For: 1.3.0
>
>
> Currently, Flink's Gauge is defined as 
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```
> But it doesn't make sense to have Gauge take generic types other than Number. 
> And it blocks I from finishing FLINK-6013, because I cannot assume Gauge is 
> only about Number. So the class should be like
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (FLINK-6053) Gauge should only take subclasses of Number, rather than everything

2017-03-14 Thread Bowen Li (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-6053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15925257#comment-15925257
 ] 

Bowen Li commented on FLINK-6053:
-

hm I found in Flink's Gauge class is used like this in 
`org.apache.flink.runtime.checkpoint.CheckpointStatsTracker`, which doesn't 
make much sense to me

```
private class LatestCompletedCheckpointExternalPathGauge implements 
Gauge {
@Override
public String getValue() {
CompletedCheckpointStats completed = 
latestSnapshot.getHistory().getLatestCompletedCheckpoint();
if (completed != null) {
return completed.getExternalPath();
} else {
return "n/a";
}
}
}
```

> Gauge should only take subclasses of Number, rather than everything
> --
>
> Key: FLINK-6053
> URL: https://issues.apache.org/jira/browse/FLINK-6053
> Project: Flink
>  Issue Type: Improvement
>  Components: Metrics
>Affects Versions: 1.2.0
>Reporter: Bowen Li
> Fix For: 1.3.0
>
>
> Currently, Flink's Gauge is defined as 
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```
> But it doesn't make sense to have Gauge take generic types other than Number. 
> And it blocks I from finishing FLINK-6013, because I cannot assume Gauge is 
> only about Number. So the class should be like
> ```java
> public interface Gauge extends Metric {
>   T getValue();
> }
> ```



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)