flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] zentol commented on a change in pull request #6850: [FLINK-10252] Handle oversized metric messges
Date Thu, 18 Oct 2018 07:57:25 GMT
zentol commented on a change in pull request #6850: [FLINK-10252] Handle oversized metric messges
URL: https://github.com/apache/flink/pull/6850#discussion_r226202165
 
 

 ##########
 File path: flink-runtime/src/main/java/org/apache/flink/runtime/metrics/dump/MetricDumpSerialization.java
 ##########
 @@ -124,50 +124,86 @@ public MetricSerializationResult serialize(
 			Map<Counter, Tuple2<QueryScopeInfo, String>> counters,
 			Map<Gauge<?>, Tuple2<QueryScopeInfo, String>> gauges,
 			Map<Histogram, Tuple2<QueryScopeInfo, String>> histograms,
-			Map<Meter, Tuple2<QueryScopeInfo, String>> meters) {
+			Map<Meter, Tuple2<QueryScopeInfo, String>> meters,
+			long maximumFramesize,
+			MetricQueryService queryService) {
 
 			buffer.clear();
+			boolean unregisterRemainingMetrics = false;
 
 			int numCounters = 0;
 			for (Map.Entry<Counter, Tuple2<QueryScopeInfo, String>> entry : counters.entrySet())
{
+				if (unregisterRemainingMetrics) {
+					queryService.unregister(entry.getKey());
+					continue;
+				}
+
 				try {
 					serializeCounter(buffer, entry.getValue().f0, entry.getValue().f1, entry.getKey());
 					numCounters++;
+					if (buffer.length() > maximumFramesize) {
+						unregisterRemainingMetrics = true;
 
 Review comment:
   In this case a warning should be logged to inform users that not all metrics can be reporter
to the UI.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message