public class DataDbLogger
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
boolean |
add(java.lang.Object o)
Adds an object to be saved in the database to the queue.
|
static DataDbLogger |
getDataDbLogger(java.lang.String projectId,
boolean shouldStoreToDb,
boolean shouldPauseToReduceQueue)
Factory method.
|
static void |
main(java.lang.String[] args)
Just for doing some testing
|
double |
queueLevel()
Returns how much capacity of the queue is being used up.
|
int |
queueSize()
Returns how many items are in queue to be processed
|
public static DataDbLogger getDataDbLogger(java.lang.String projectId, boolean shouldStoreToDb, boolean shouldPauseToReduceQueue)
projectId
- Id of database to be written toshouldStoreToDb
- Specifies whether data should actually be written to db. If in
playback mode and shouldn't write data to db then set to
false.shouldPauseToReduceQueue
- Specifies if should pause the thread calling add() if the
queue is filling up. Useful for when in batch mode and dumping
a whole bunch of data to the db really quickly.public double queueLevel()
public int queueSize()
public boolean add(java.lang.Object o)
o
- The object that should be logged to the databasepublic static void main(java.lang.String[] args)
args
-