public class MINAStatCollector extends Object
org.apache.mina.common.IoService
. It's polling all the sessions of a given
IoService. It's attaching a org.apache.mina.management.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
org.apache.mina.management.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
org.apache.mina.common.IoSession of the org.apache.mina.common.IoService |
void |
start()
Start collecting stats for the
org.apache.mina.common.IoSession of the service. |
void |
stop()
Stop collecting stats.
|
public static final String KEY
org.apache.mina.management.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()
org.apache.mina.common.IoSession
of the service.
New sessions or destroyed will be automaticly added or removed.public void stop()
org.apache.mina.management.IoSessionStat
object will be removed of the
polled session attachements.public boolean isRunning()
org.apache.mina.common.IoSession
of the org.apache.mina.common.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–2019 Ignite Realtime. All rights reserved.