Permalink
Browse files

Adding documentation.

  • Loading branch information...
brianfrankcooper committed Apr 23, 2010
1 parent 6e426ca commit 70c480ec4b5391457a82e32b56c95883e026901e
Showing with 18 additions and 16 deletions.
  1. +0 −16 src/com/yahoo/ycsb/DBFactory.java
  2. +18 −0 src/com/yahoo/ycsb/Measurements.java
@@ -47,22 +47,6 @@ public static DB newDB(String dbname, Properties properties) throws UnknownDBExc
ret.setProperties(properties);
return new DBWrapper(ret);
-
- /*
- DB ret;
-
- if (dbname.compareTo("BasicDB")==0)
- {
- ret=new BasicDB();
- }
- else
- {
- throw new UnknownDBException(dbname);
- }
-
- ret.setProperties(properties);
- return ret;
- */
}
}
@@ -42,6 +42,9 @@ public static void setProperties(Properties props)
measurementproperties=props;
}
+ /**
+ * Return the singleton Measurements object.
+ */
public synchronized static Measurements getMeasurements()
{
if (singleton==null)
@@ -56,6 +59,9 @@ public synchronized static Measurements getMeasurements()
private Properties _props;
+ /**
+ * Create a new object with the specified properties.
+ */
public Measurements(Properties props)
{
data=new HashMap<String,OneMeasurement>();
@@ -84,6 +90,9 @@ OneMeasurement constructOneMeasurement(String name)
}
}
+ /**
+ * Report a single value of a single metric. E.g. for read latency, operation="READ" and latency is the measured value.
+ */
public synchronized void measure(String operation, int latency)
{
if (!data.containsKey(operation))
@@ -108,6 +117,9 @@ public synchronized void measure(String operation, int latency)
}
}
+ /**
+ * Report a return code for a single DB operaiton.
+ */
public void reportReturnCode(String operation, int code)
{
if (!data.containsKey(operation))
@@ -123,6 +135,9 @@ public void reportReturnCode(String operation, int code)
data.get(operation).reportReturnCode(code);
}
+ /**
+ * Print the full report to the listed PrintStream.
+ */
public void printReport(PrintStream out)
{
for (OneMeasurement m : data.values())
@@ -131,6 +146,9 @@ public void printReport(PrintStream out)
}
}
+ /**
+ * Return a one line summary of the measurements.
+ */
public String getSummary()
{
String ret="";

0 comments on commit 70c480e

Please sign in to comment.