|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.ricebridge.xmlman.Stats
Access statistics about the current load or save operation.
You can get the current statistics object by calling the XmlManager.getStats() method.
XML Manager collects a number of statistics about the
load or save operation, and you can access them using the methods of this class.
The statistics collected are:
total records loaded or saved (including bad records)total bad records encounteredtotal time taken in milliseconds (a long)total time taken in seconds (a double)average time per record in seconds (a double)start time (a Date)end time (a Date)The Stats object contains the statistics for the most recent load or save operation.
Each operation creates a new object, so you can continue to use existing objects for as long as you like.
When running the load or save process in the background in a separate thread,
you can still use the Stats object, as it is updated dynamically. This means you can monitor the
load or save operation and use this to provide progress reporting.
To get a quick overview of the statistics as a String, use the getSummary() method.
XmlManager,
XmlSpec| Field Summary | |
protected long |
iBadRecords
Count of bad records (does not include bad records due to XML syntax errors). |
protected Date |
iEndDate
End time of the load or save process. |
protected Date |
iStartDate
Start time of the load or save process. |
protected long |
iTotalRecords
Count of total records, including bad records. |
| Constructor Summary | |
Stats()
Create a new Stats object. |
|
| Method Summary | |
protected void |
clear()
Zero all the counters. |
double |
getAverageTimePerRecordInSeconds()
Get the average time taken to process each record in seconds. |
Date |
getEndDate()
Get the Date at which processing ended. |
Date |
getStartDate()
Get the Date at which processing started. |
String |
getSummary()
Get a summary String containing the statistics of the previous or running operation. |
long |
getTimeTaken()
Get the total time in milliseconds taken to process all records. |
double |
getTimeTakenInSeconds()
Get the total time in seconds taken to process all lines. |
long |
getTotalBadRecords()
Get the number of bad data records when loading or saving. |
long |
getTotalRecords()
Get the number of data records loaded or saved. |
String |
toString()
Return the summary string. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected long iTotalRecords
protected long iBadRecords
protected Date iStartDate
protected Date iEndDate
| Constructor Detail |
public Stats()
Stats object.
| Method Detail |
public long getTotalRecords()
If the load or save process is running in a separate Thread (see XmlSpec.setBackground(boolean)),
this method returns the number of records currently processed.
Note: the record count includes the number of bad records found.
getTotalBadRecords(),
getSummary(),
BadRecordpublic long getTotalBadRecords()
If the load or save process is running in a separate Thread (see XmlSpec.setBackground(boolean)),
this method returns the number of bad records currently processed.
When the XmlSpec.setIgnoreBadRecords(boolean) property is true, this method returns a count of all bad records
seen. When false, it has a value of at most one (as processing halts).
Note: the getTotalRecords() method includes the number of bad records found.
getTotalRecords(),
getSummary(),
BadRecordpublic Date getStartDate()
Date at which processing started.
getSummary()public Date getEndDate()
Date at which processing ended.
getSummary()public double getAverageTimePerRecordInSeconds()
This provides a running average if the process is running in the background.
getSummary()public long getTimeTaken()
This provides a running total if the process is running in the background.
getSummary()public double getTimeTakenInSeconds()
This provides a running total if the process is running in the background.
getSummary()public String getSummary()
String containing the statistics of the previous or running operation.
An example result String is:
[XML:Summary:fin=true:recs=22:bad=0:avgsec=0.0005:totalsec=0.01: \
start=20051013061519:end=20051013061519]
The result String is designed for machine and human readability and has the general format:
[XML:Summary:fin={boolean}:recs={long}:bad={long}:avgsec={0.####}:totalsec={0.####}: \
start={yyyyMMddhhmmss}:end={yyyyMMddhhmmss}]
getTotalRecords(),
getTotalBadRecords(),
getTimeTaken(),
getTimeTakenInSeconds(),
getAverageTimePerRecordInSeconds(),
getStartDate(),
getEndDate()public String toString()
getSummary()protected void clear()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||