pnowojski commented on a change in pull request #18991:
URL: https://github.com/apache/flink/pull/18991#discussion_r824687883



##########
File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/mailbox/MailboxProcessor.java
##########
@@ -175,6 +199,7 @@ public void close() {
     public void drain() throws Exception {
         for (final Mail mail : mailbox.drain()) {
             mail.run();
+            mailboxThroughputMeter.markEvent();

Review comment:
       > Well, with a quick look at SumCounter, I actually don't understand why 
this needs to extend the SimpleCounter ... looks a bit hacky to me. I assume it 
should rather implement the Counter interface ... not sure though.
   
   You can try it out and refactor it if you want/think it's worth it.
   
   I was thinking about one of the following ideas:
   1. Pass `SimpleCounter`, not `Counter` to the `MailboxProcessor`. 
   2. Defining `public static final class MailboxLengthCounter extends 
SimpleCounter {}` (or sth like that).
   
   However on a second thought, it shouldn't matter. Every enqueued mail has to 
go through threads synchronisation while being enqueued, so an extra virtual 
call here or there should be negligible in comparison. Let's keep it as it is.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to