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 written bytes. This information is used by the outgoing * bytes statistic. * * @param session the session that wrote more bytes to the socket. */ private void updateWrittenBytesCounter(IoSession session) { long currentBytes = session.getWrittenBytes(); Long prevBytes = (Long) session.getAttribute("_written_bytes"); long delta; if (prevBytes == null) { delta = currentBytes; } else { delta = currentBytes - prevBytes; } session.setAttribute("_written_bytes", currentBytes); ServerTrafficCounter.incrementOutgoingCounter(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 writtenBytes = session.getWrittenBytes(); long readMessages = session.getReadMessages(); long writtenMessages = session.getWrittenMessages();
/** * @see IoSession#getWrittenBytes() */ public long getWrittenBytes() { return wrappedSession.getWrittenBytes(); }
/** {@inheritDoc} */ @Override public long getWrittenBytes() { if (ioSession != null) { return ioSession.getWrittenBytes(); } return 0; }
/** {@inheritDoc} */ @Override public long getWrittenBytes() { if (ioSession != null) { return ioSession.getWrittenBytes(); } 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 written bytes. This information is used by the outgoing * bytes statistic. * * @param session the session that wrote more bytes to the socket. */ private void updateWrittenBytesCounter(IoSession session) { long currentBytes = session.getWrittenBytes(); Long prevBytes = (Long) session.getAttribute("_written_bytes"); long delta; if (prevBytes == null) { delta = currentBytes; } else { delta = currentBytes - prevBytes; } session.setAttribute("_written_bytes", currentBytes); ServerTrafficCounter.incrementOutgoingCounter(delta); } }
long writtenBytes = session.getWrittenBytes(); long readMessages = session.getReadMessages(); long writtenMessages = session.getWrittenMessages();
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());