Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding documentation.

  • Loading branch information...
commit 70c480ec4b5391457a82e32b56c95883e026901e 1 parent 6e426ca
@brianfrankcooper brianfrankcooper authored
View
16 src/com/yahoo/ycsb/DBFactory.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;
- */
}
}
View
18 src/com/yahoo/ycsb/Measurements.java
@@ -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="";
Please sign in to comment.
Something went wrong with that request. Please try again.