|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.activemq.journal.JournalStatsFilter
A Journal filter that captures performance statistics of the filtered Journal.
Constructor Summary | |
JournalStatsFilter(Journal next)
Creates a JournalStatsFilter that captures performance information of next. |
Method Summary | |
void |
close()
Close the Journal. |
void |
dump(IndentPrinter out)
Writes the gathered statistics to the out object. |
JournalStatsFilter |
enableDetailedStats(boolean detailedStats)
|
double |
getAvgSyncedLatencyMs()
Gets the average sync write latency in ms. |
double |
getAvgUnSyncedLatencyMs()
Gets the average non sync write latency in ms. |
RecordLocation |
getMark()
Obtains the mark that was set in the Journal. |
RecordLocation |
getNextRecordLocation(RecordLocation lastLocation)
Allows you to get the next RecordLocation after the location that
is in the journal. |
double |
getThroughputKps()
Gets the average throughput in k/s. |
double |
getThroughputRps()
Gets the average throughput in records/s. |
double |
getWritesPerSecond()
Gets the average number of writes done per second |
byte[] |
read(RecordLocation location)
Reads a previously written record from the journal. |
void |
reset()
Resets the stats sample. |
void |
setJournalEventListener(JournalEventListener eventListener)
Registers a JournalEventListener that will receive notifications from the Journal. |
void |
setMark(RecordLocation recordLocator,
boolean force)
Informs the journal that all the journal space up to the location is no longer
needed and can be reclaimed for reuse. |
String |
toString()
Dumps the stats to a String. |
RecordLocation |
write(byte[] data,
boolean sync)
Writes a byte array record to the journal. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public JournalStatsFilter(Journal next)
next.
- Parameters:
next
-
Method Detail |
public RecordLocation write(byte[] data, boolean sync) throws IOException
Journal
record
to the journal. If sync
is true, then this call blocks until the data has landed on the physical
disk. Otherwise, this call returns imeadiatly.
write
in interface Journal
data
- - the data to be written to disk.sync
- - If this call should block until the data lands on disk.
IOException
- if the write failed.Journal.write(byte[], boolean)
public byte[] read(RecordLocation location) throws InvalidRecordLocationException, IOException
Journal
read
in interface Journal
location
- is where to read the record from.
location
.
IOException
- if the record could not be read.
InvalidRecordLocationException
- if location
parameter is out of range.
It cannot be a location that is before the current mark.Journal.read(org.codehaus.activemq.journal.RecordLocation)
public void setMark(RecordLocation recordLocator, boolean force) throws InvalidRecordLocationException, IOException
Journal
location
is no longer
needed and can be reclaimed for reuse.
setMark
in interface Journal
recordLocator
- the location of the record to mark. All record locations before the marked
location will no longger be vaild.force
- if this call should block until the mark is set on the journal.
InvalidRecordLocationException
- if location
parameter is out of range.
It cannot be a location that is before the current mark.
IOException
- if the record could not be read.Journal.setMark(org.codehaus.activemq.journal.RecordLocation, boolean)
public RecordLocation getMark()
Journal
getMark
in interface Journal
Journal.getMark()
public void close() throws IOException
Journal
close
in interface Journal
IOException
- if an error occurs while the journal is being closed.Journal.close()
public void setJournalEventListener(JournalEventListener eventListener)
Journal
JournalEventListener
that will receive notifications from the Journal.
setJournalEventListener
in interface Journal
eventListener
- object that will receive journal events.Journal.setJournalEventListener(org.codehaus.activemq.journal.JournalEventListener)
public RecordLocation getNextRecordLocation(RecordLocation lastLocation) throws IOException, InvalidRecordLocationException
Journal
location
that
is in the journal.
getNextRecordLocation
in interface Journal
lastLocation
- the reference location the is used to find the next location.
To get the oldest location available in the journal, location
should be set to null.
InvalidRecordLocationException
- if location
parameter is out of range.
It cannot be a location that is before the current mark.
IOException
Journal.getNextRecordLocation(org.codehaus.activemq.journal.RecordLocation)
public void dump(IndentPrinter out)
out
object.
out
- public String toString()
Object.toString()
public JournalStatsFilter enableDetailedStats(boolean detailedStats)
detailedStats
- true if details stats should be displayed by toString()
and dump
public double getThroughputKps()
public double getThroughputRps()
public double getWritesPerSecond()
public double getAvgSyncedLatencyMs()
public double getAvgUnSyncedLatencyMs()
public void reset()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |