[
https://issues.apache.org/jira/browse/FLINK-7608?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16207587#comment-16207587
]
ASF GitHub Bot commented on FLINK-7608:
---------------------------------------
Github user zentol commented on a diff in the pull request:
https://github.com/apache/flink/pull/4826#discussion_r145114978
--- Diff:
flink-streaming-java/src/main/java/org/apache/flink/streaming/util/latency/LatencyHistogramStatistics.java
---
@@ -0,0 +1,71 @@
+/*
+ * 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.streaming.util.latency;
+
+import org.apache.flink.metrics.HistogramStatistics;
+
+import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics;
+
+
+/**
+ * Latency histogram statistics implementation returned by {@link
LatencyHistogram}.
+ * The statistics class wraps a {@link DescriptiveStatistics} instance and
forwards the method calls accordingly.
+ */
+public class LatencyHistogramStatistics extends HistogramStatistics {
+ private final DescriptiveStatistics latencyHistogram;
+
+ public LatencyHistogramStatistics(DescriptiveStatistics
latencyHistogram) {
+ this.latencyHistogram = latencyHistogram;
+ }
+
+ @Override
+ public double getQuantile(double quantile) {
+ return latencyHistogram.getPercentile(quantile);
+ }
+
+ @Override
+ public long[] getValues() {
+ // Due to latencyHistogram.getValues() return double[]
+ throw new UnsupportedOperationException();
--- End diff --
probably better to return an empty array instead.
> LatencyGauge change to histogram metric
> ----------------------------------------
>
> Key: FLINK-7608
> URL: https://issues.apache.org/jira/browse/FLINK-7608
> Project: Flink
> Issue Type: Bug
> Components: Metrics
> Reporter: Hai Zhou UTC+8
> Assignee: Hai Zhou UTC+8
> Priority: Blocker
> Fix For: 1.4.0, 1.3.3
>
>
> I used slf4jReporter[https://issues.apache.org/jira/browse/FLINK-4831] to
> export metrics the log file.
> I found:
> {noformat}
> -- Gauges
> ---------------------------------------------------------------------
> ......
> zhouhai-mbp.taskmanager.f3fd3a269c8c3da4e8319c8f6a201a57.Flink Streaming
> Job.Map.0.latency:
> value={LatencySourceDescriptor{vertexID=1, subtaskIndex=-1}={p99=116.0,
> p50=59.5, min=11.0, max=116.0, p95=116.0, mean=61.833333333333336}}
> zhouhai-mbp.taskmanager.f3fd3a269c8c3da4e8319c8f6a201a57.Flink Streaming
> Job.Sink- Unnamed.0.latency:
> value={LatencySourceDescriptor{vertexID=1, subtaskIndex=0}={p99=195.0,
> p50=163.5, min=115.0, max=195.0, p95=195.0, mean=161.0}}
> ......
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)