public KubernetesClientMetrics()

in flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/metrics/KubernetesClientMetrics.java [73:121]


    public KubernetesClientMetrics(
            MetricGroup parentGroup, FlinkOperatorConfiguration flinkOperatorConfiguration) {
        MetricGroup metricGroup = parentGroup.addGroup(KUBE_CLIENT_GROUP);

        this.requestMetricGroup = metricGroup.addGroup(HTTP_REQUEST_GROUP);
        this.failedRequestMetricGroup = requestMetricGroup.addGroup(HTTP_REQUEST_FAILED_GROUP);
        this.responseMetricGroup = metricGroup.addGroup(HTTP_RESPONSE_GROUP);

        this.requestCounter =
                OperatorMetricUtils.synchronizedCounter(requestMetricGroup.counter(COUNTER));
        this.failedRequestCounter =
                OperatorMetricUtils.synchronizedCounter(failedRequestMetricGroup.counter(COUNTER));
        this.responseCounter =
                OperatorMetricUtils.synchronizedCounter(responseMetricGroup.counter(COUNTER));

        this.requestRateMeter =
                OperatorMetricUtils.synchronizedMeterView(
                        requestMetricGroup.meter(METER, new MeterView(requestCounter)));
        this.requestFailedRateMeter =
                OperatorMetricUtils.synchronizedMeterView(
                        failedRequestMetricGroup.meter(METER, new MeterView(failedRequestCounter)));
        this.responseRateMeter =
                OperatorMetricUtils.synchronizedMeterView(
                        responseMetricGroup.meter(METER, new MeterView(responseCounter)));

        this.responseLatency =
                responseMetricGroup.histogram(
                        HISTO, OperatorMetricUtils.createHistogram(flinkOperatorConfiguration));

        this.httpResponseCodeGroupsEnabled =
                flinkOperatorConfiguration.isKubernetesClientMetricsHttpResponseCodeGroupsEnabled();
        if (this.httpResponseCodeGroupsEnabled) {
            this.responseCodeGroupMeters.add(
                    createMeterViewForMetricsGroup(
                            responseMetricGroup.addGroup(HTTP_RESPONSE_1XX)));
            this.responseCodeGroupMeters.add(
                    createMeterViewForMetricsGroup(
                            responseMetricGroup.addGroup(HTTP_RESPONSE_2XX)));
            this.responseCodeGroupMeters.add(
                    createMeterViewForMetricsGroup(
                            responseMetricGroup.addGroup(HTTP_RESPONSE_3XX)));
            this.responseCodeGroupMeters.add(
                    createMeterViewForMetricsGroup(
                            responseMetricGroup.addGroup(HTTP_RESPONSE_4XX)));
            this.responseCodeGroupMeters.add(
                    createMeterViewForMetricsGroup(
                            responseMetricGroup.addGroup(HTTP_RESPONSE_5XX)));
        }
    }