stevenzwu commented on code in PR #5348:
URL: https://github.com/apache/iceberg/pull/5348#discussion_r929031193
##########
api/src/main/java/org/apache/iceberg/metrics/DefaultMetricsContext.java:
##########
@@ -42,4 +42,21 @@ public <T extends Number> Counter<T> counter(String name,
Class<T> type, Unit un
public Timer timer(String name, TimeUnit unit) {
return new DefaultTimer(unit);
}
+
+ @Override
+ public <T extends Number> Gauge<T> gauge(String name, Class<T> type) {
+ if (Integer.class.equals(type)) {
+ return (Gauge<T>) new IntGauge();
+ }
+
+ if (Long.class.equals(type)) {
+ return (Gauge<T>) new LongGauge();
+ }
+ throw new IllegalArgumentException(String.format("Counter for type %s is
not supported", type.getName()));
Review Comment:
good catch. fixed.
--
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]