public class MINAStatCollector extends Object
IoService
. It's polling all the sessions of a given
IoService. It's attaching a MINAStatCollector.IoSessionStat
object to all the sessions polled
and filling the throughput values.
Usage :
IoService service = ... MINAStatCollector collector = new MINAStatCollector( service ); collector.start();By default the
MINAStatCollector
is polling the sessions every 5 seconds. You can
give a different polling time using a second constructor.Note: This class is a spin-off from StatCollector present in https://svn.apache.org/repos/asf/mina/branches/1.1/core/src/main/java/org/apache/mina/management.
Modifier and Type | Class and Description |
---|---|
class |
MINAStatCollector.IoSessionStat |
Modifier and Type | Field and Description |
---|---|
static String |
KEY
The session attribute key for
MINAStatCollector.IoSessionStat . |
Constructor and Description |
---|
MINAStatCollector(org.apache.mina.core.service.IoService service)
Create a stat collector for the given service with a default polling time of 5 seconds.
|
MINAStatCollector(org.apache.mina.core.service.IoService service,
int pollingInterval)
create a stat collector for the given given service
|
Modifier and Type | Method and Description |
---|---|
long |
getBytesRead() |
long |
getBytesWritten() |
long |
getMsgRead() |
long |
getMsgWritten() |
long |
getQueuedEvents() |
long |
getScheduledWrites() |
long |
getSessionCount() |
long |
getTotalProcessedSessions()
total number of sessions processed by the stat collector
|
boolean |
isRunning()
is the stat collector started and polling the
IoSession of the IoService |
void |
start()
Start collecting stats for the
IoSession of the service. |
void |
stop()
Stop collecting stats.
|
public static final String KEY
MINAStatCollector.IoSessionStat
.public MINAStatCollector(org.apache.mina.core.service.IoService service)
service
- the IoService to inspectpublic MINAStatCollector(org.apache.mina.core.service.IoService service, int pollingInterval)
service
- the IoService to inspectpollingInterval
- millisecondspublic void start()
IoSession
of the service.
New sessions or destroyed will be automaticly added or removed.public void stop()
MINAStatCollector.IoSessionStat
object will be removed of the
polled session attachements.public boolean isRunning()
IoSession
of the IoService
public long getTotalProcessedSessions()
public long getBytesRead()
public long getBytesWritten()
public long getMsgRead()
public long getMsgWritten()
public long getScheduledWrites()
public long getQueuedEvents()
public long getSessionCount()
Copyright © 2003–2020 Ignite Realtime. All rights reserved.