Github user zentol commented on a diff in the pull request:
https://github.com/apache/flink/pull/4725#discussion_r192222379
--- Diff:
flink-connectors/flink-jdbc/src/main/java/org/apache/flink/api/java/io/jdbc/JDBCOutputFormat.java
---
@@ -82,6 +97,22 @@ public void open(int taskNumber, int numTasks) throws
IOException {
} catch (ClassNotFoundException cnfe) {
throw new IllegalArgumentException("JDBC driver class
not found.", cnfe);
}
+ this.flushMeter = getRuntimeContext()
+ .getMetricGroup()
+ .addGroup(FLUSH_SCOPE)
+ .meter(FLUSH_RATE_METER_NAME, new
DropwizardMeterWrapper(new com.codahale.metrics.Meter()));
+ this.batchLimitReachedMeter = getRuntimeContext()
+ .getMetricGroup()
+ .addGroup(FLUSH_SCOPE)
+ .meter(BATCH_LIMIT_REACHED_RATE_METER_NAME, new
DropwizardMeterWrapper(new com.codahale.metrics.Meter()));
+ this.flushDurationMsHisto = getRuntimeContext()
+ .getMetricGroup()
+ .addGroup(FLUSH_SCOPE)
+ .histogram(FLUSH_DURATION_HISTO_NAME, new
DropwizardHistogramWrapper(new com.codahale.metrics.Histogram(new
ExponentiallyDecayingReservoir())));
--- End diff --
I recommend staying away form histograms as long as possible. Most metric
backends recommend to _not_ build histograms in the application, but let the
backend handle it.
---