public void initMetric() {
        dtNumRecordsOut = runtimeContext.getMetricGroup().counter(MetricConstant.DT_NUM_RECORDS_OUT);
        dtNumRecordsOutRate = runtimeContext.getMetricGroup().meter(MetricConstant.DT_NUM_RECORDS_OUT_RATE, new MeterView(dtNumRecordsOut, 20));
    }
add metric for source
<p>
company: www.dtstack.com
author: toutian
create: 2019/12/24
core/src/main/java/com/dtstack/flink/sql/format/SerializationMetricWrapper.java