mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mondain <mond...@gmail.com>
Subject Getting scheduled write message count is inaccurate for UDP sessions
Date Wed, 03 Oct 2018 14:25:28 GMT
I was looking into an issue reported in our use of UDP sessions in Mina
2.0.19. The IoSession.getScheduledWriteMessages() seemed to give very odd
and varying results when more than one session existed. It seems that the
scheduledWriteMessages stat comes from the acceptor, which in our case is
"shared" so the value will be inaccurate per individual session; stat
updates in AbstractIoSession here:

    /**
     * Increase the number of scheduled message to write
     */
    public final void increaseScheduledWriteMessages() {
        scheduledWriteMessages.incrementAndGet();

        if (getService() instanceof AbstractIoService) {
            ((AbstractIoService)
getService()).getStatistics().increaseScheduledWriteMessages();
        }
    }

    /**
     * Decrease the number of scheduled message written
     */
    private void decreaseScheduledWriteMessages() {
        scheduledWriteMessages.decrementAndGet();
        if (getService() instanceof AbstractIoService) {
            ((AbstractIoService)
getService()).getStatistics().decreaseScheduledWriteMessages();
        }
    }

If all this is accurate and by-design, what would be the best way to
determine how many writes are scheduled for an individual session?

Best Regards,
Paul

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message