@ Override public final void onMessageReceived ( final Session session , final Object msg ) { Command command = ( Command ) msg ; if ( this . statisticsHandler . isStatistics ( ) ) { if ( command . getCopiedMergeCount ( ) > 0 && command instanceof MapReturnValueAware ) { Map < String , CachedData > returnValues = ( ( MapReturnValueAware ) command ) . getReturnValues ( ) ; int size = returnValues . size ( ) ; this . statisticsHandler . statistics ( CommandType . GET_HIT , size ) ; this . statisticsHandler . statistics ( CommandType . GET_MISS , command . getCopiedMergeCount ( ) - size ) ; } else if ( command instanceof TextGetOneCommand || command instanceof BinaryGetCommand ) { if ( command . getResult ( ) != null ) { this . statisticsHandler . statistics ( CommandType . GET_HIT ) ; } else { this . statisticsHandler . statistics ( CommandType . GET_MISS ) ; } } else { if ( command . getCopiedMergeCount ( ) > 0 ) { this . statisticsHandler . statistics ( command . getCommandType ( ) , command . getCopiedMergeCount ( ) ) ; } else this . statisticsHandler . statistics ( command . getCommandType ( ) ) ; } } }
On receive message from memcached server