private void removeSession( IoSession session ) { // remove the session from the list of polled sessions polledSessions.remove( session ); // add the bytes processed between last polling and session closing // prevent non seen byte with non-connected protocols like HTTP and datagrams IoSessionStat sessStat = ( IoSessionStat ) session.removeAttribute( KEY ); if (sessStat != null) { totalMsgWritten.addAndGet(session.getWrittenMessages() - sessStat.lastMessageWrite); totalMsgRead.addAndGet(session.getReadMessages() - sessStat.lastMessageRead); totalBytesWritten.addAndGet(session.getWrittenBytes() - sessStat.lastByteWrite); totalBytesRead.addAndGet(session.getReadBytes() - sessStat.lastByteRead); } }
private void updateStats ( final IoSession session ) { final StatisticsImpl stats = getStats ( session ); if ( stats != null ) { stats.setCurrentValue ( STATS_READ_BYTES, session.getReadBytes () ); stats.setCurrentValue ( STATS_WRITTEN_BYTES, session.getWrittenBytes () ); stats.setCurrentValue ( STATS_SCHEDULED_WRITE_BYTES, session.getScheduledWriteBytes () ); stats.setCurrentValue ( STATS_READ_BYTES_THROUGHPUT, session.getReadBytesThroughput () ); stats.setCurrentValue ( STATS_WRITTEN_BYTES_THROUGHPUT, session.getWrittenBytesThroughput () ); } }
/** * Updates the system counter of read bytes. This information is used by the incoming * bytes statistic. * * @param session the session that read more bytes from the socket. */ private void updateReadBytesCounter(IoSession session) { long currentBytes = session.getReadBytes(); Long prevBytes = (Long) session.getAttribute("_read_bytes"); long delta; if (prevBytes == null) { delta = currentBytes; } else { delta = currentBytes - prevBytes; } session.setAttribute("_read_bytes", currentBytes); ServerTrafficCounter.incrementIncomingCounter(delta); }
private void updateStats ( final IoSession session ) { final StatisticsImpl stats = getStats ( session ); if ( stats != null ) { stats.setCurrentValue ( STATS_READ_BYTES, session.getReadBytes () ); stats.setCurrentValue ( STATS_WRITTEN_BYTES, session.getWrittenBytes () ); stats.setCurrentValue ( STATS_SCHEDULED_WRITE_BYTES, session.getScheduledWriteBytes () ); stats.setCurrentValue ( STATS_READ_BYTES_THROUGHPUT, session.getReadBytesThroughput () ); stats.setCurrentValue ( STATS_WRITTEN_BYTES_THROUGHPUT, session.getWrittenBytesThroughput () ); } }
/** {@inheritDoc} */ @Override public void sessionIdle(IoSession session, IdleStatus status) throws Exception { if (log.isTraceEnabled()) { log.trace("Idle (session: {}) local: {} remote: {}\nread: {} write: {}", session.getId(), session.getLocalAddress(), session.getRemoteAddress(), session.getReadBytes(), session.getWrittenBytes()); } String sessionId = (String) session.getAttribute(RTMPConnection.RTMP_SESSION_ID); if (sessionId != null) { RTMPMinaConnection conn = (RTMPMinaConnection) RTMPConnManager.getInstance().getConnectionBySessionId(sessionId); if (conn != null) { // close the idle socket conn.onInactive(); } } }
long readBytes = session.getReadBytes(); long writtenBytes = session.getWrittenBytes(); long readMessages = session.getReadMessages();
/** {@inheritDoc} */ @Override public long getReadBytes() { if (ioSession != null) { return ioSession.getReadBytes(); } return 0; }
/** * @see IoSession#getReadBytes() */ public long getReadBytes() { return wrappedSession.getReadBytes(); }
/** {@inheritDoc} */ @Override public long getReadBytes() { if (ioSession != null) { return ioSession.getReadBytes(); } return 0; }
/** {@inheritDoc} */ @Override public void messageSent(IoSession session, Object message) throws Exception { if (log.isTraceEnabled()) { log.trace("Message sent (session: {}) read: {} write: {}\n{}", session.getId(), session.getReadBytes(), session.getWrittenBytes(), String.valueOf(message)); } }
private void removeSession( IoSession session ) { // remove the session from the list of polled sessions polledSessions.remove( session ); // add the bytes processed between last polling and session closing // prevent non seen byte with non-connected protocols like HTTP and datagrams IoSessionStat sessStat = ( IoSessionStat ) session.removeAttribute( KEY ); if (sessStat != null) { totalMsgWritten.addAndGet(session.getWrittenMessages() - sessStat.lastMessageWrite); totalMsgRead.addAndGet(session.getReadMessages() - sessStat.lastMessageRead); totalBytesWritten.addAndGet(session.getWrittenBytes() - sessStat.lastByteWrite); totalBytesRead.addAndGet(session.getReadBytes() - sessStat.lastByteRead); } }
/** * Updates the system counter of read bytes. This information is used by the incoming * bytes statistic. * * @param session the session that read more bytes from the socket. */ private void updateReadBytesCounter(IoSession session) { long currentBytes = session.getReadBytes(); Long prevBytes = (Long) session.getAttribute("_read_bytes"); long delta; if (prevBytes == null) { delta = currentBytes; } else { delta = currentBytes - prevBytes; } session.setAttribute("_read_bytes", currentBytes); ServerTrafficCounter.incrementIncomingCounter(delta); }
long readBytes = session.getReadBytes(); long writtenBytes = session.getWrittenBytes(); long readMessages = session.getReadMessages();
public void sessionIdle(IoSession session, IdleStatus status) throws Exception { log.info("Idle (session: {}) local: {} remote: {}\nread: {} write: {}", session.getId(), session.getLocalAddress(), session.getRemoteAddress(), session.getReadBytes(), session.getWrittenBytes());