Skip to content
Snippets Groups Projects
Commit 70c480ec authored by Brian Frank Cooper's avatar Brian Frank Cooper
Browse files

Adding documentation.

parent 6e426ca7
No related branches found
No related tags found
No related merge requests found
......@@ -47,22 +47,6 @@ public class DBFactory
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 class Measurements
measurementproperties=props;
}
/**
* Return the singleton Measurements object.
*/
public synchronized static Measurements getMeasurements()
{
if (singleton==null)
......@@ -56,6 +59,9 @@ public class Measurements
private Properties _props;
/**
* Create a new object with the specified properties.
*/
public Measurements(Properties props)
{
data=new HashMap<String,OneMeasurement>();
......@@ -84,6 +90,9 @@ public class Measurements
}
}
/**
* 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 class Measurements
}
}
/**
* 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 class Measurements
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 class Measurements
}
}
/**
* Return a one line summary of the measurements.
*/
public String getSummary()
{
String ret="";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment