Permalink
Browse files

gh-100 Time clean up and count it for hbase as update.

* Time the cleanUp of a DBWrapper
* For HBase this clean up should also be counted as an update.
  • Loading branch information...
1 parent 9b38c15 commit 89df1ac1e6ed5d90b56cd5cc33721ede3f68795a @elliottneilclark elliottneilclark committed with Michi Mutsuzaki Nov 2, 2012
@@ -69,7 +69,10 @@ public void init() throws DBException
*/
public void cleanup() throws DBException
{
+ long st=System.nanoTime();
_db.cleanup();
+ long en=System.nanoTime();
+ _measurements.measure("CLEANUP", (int)((en-st)/1000));
}
/**
@@ -30,6 +30,7 @@
//import java.util.Set;
//import java.util.Vector;
+import com.yahoo.ycsb.measurements.Measurements;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.KeyValue;
import org.apache.hadoop.hbase.client.HTable;
@@ -96,10 +97,16 @@ public void init() throws DBException
*/
public void cleanup() throws DBException
{
+ // Get the measurements instance as this is the only client that should
+ // count clean up time like an update since autoflush is off.
+ Measurements _measurements = Measurements.getMeasurements();
try {
+ long st=System.nanoTime();
if (_hTable != null) {
_hTable.flushCommits();
}
+ long en=System.nanoTime();
+ _measurements.measure("UPDATE", (int)((en-st)/1000));
} catch (IOException e) {
throw new DBException(e);
}

0 comments on commit 89df1ac

Please sign in to comment.