Commit 6647cf9a authored by Dave Cridland's avatar Dave Cridland

Merge pull request #173 from tevans/OF-878

OF-878: NPE in MINAStatCollector
parents 07b73477 c5d906a3
...@@ -206,13 +206,14 @@ public class MINAStatCollector { ...@@ -206,13 +206,14 @@ public class MINAStatCollector {
// add the bytes processed between last polling and session closing // add the bytes processed between last polling and session closing
// prevent non seen byte with non-connected protocols like HTTP and datagrams // prevent non seen byte with non-connected protocols like HTTP and datagrams
IoSessionStat sessStat = ( IoSessionStat ) session.getAttribute( KEY ); IoSessionStat sessStat = ( IoSessionStat ) session.removeAttribute( KEY );
session.removeAttribute( KEY );
totalMsgWritten.addAndGet(session.getWrittenMessages() - sessStat.lastMessageWrite); if (sessStat != null) {
totalMsgRead.addAndGet(session.getReadMessages() - sessStat.lastMessageRead); totalMsgWritten.addAndGet(session.getWrittenMessages() - sessStat.lastMessageWrite);
totalBytesWritten.addAndGet(session.getWrittenBytes() - sessStat.lastByteWrite); totalMsgRead.addAndGet(session.getReadMessages() - sessStat.lastMessageRead);
totalBytesRead.addAndGet(session.getReadBytes() - sessStat.lastByteRead); totalBytesWritten.addAndGet(session.getWrittenBytes() - sessStat.lastByteWrite);
totalBytesRead.addAndGet(session.getReadBytes() - sessStat.lastByteRead);
}
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment