com.yahoo.ycsb.measurements
Class Measurements

java.lang.Object
  extended by com.yahoo.ycsb.measurements.Measurements

public class Measurements
extends java.lang.Object

Collects latency measurements, and reports them when requested.

Author:
cooperb

Constructor Summary
Measurements(java.util.Properties props)
          Create a new object with the specified properties.
 
Method Summary
 void exportMeasurements(MeasurementsExporter exporter)
          Export the current measurements to a suitable format.
static Measurements getMeasurements()
          Return the singleton Measurements object.
 java.lang.String getSummary()
          Return a one line summary of the measurements.
 void measure(java.lang.String operation, int latency)
          Report a single value of a single metric.
 void reportReturnCode(java.lang.String operation, int code)
          Report a return code for a single DB operaiton.
static void setProperties(java.util.Properties props)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Measurements

public Measurements(java.util.Properties props)
Create a new object with the specified properties.

Method Detail

setProperties

public static void setProperties(java.util.Properties props)

getMeasurements

public static Measurements getMeasurements()
Return the singleton Measurements object.


measure

public void measure(java.lang.String operation,
                    int latency)
Report a single value of a single metric. E.g. for read latency, operation="READ" and latency is the measured value.


reportReturnCode

public void reportReturnCode(java.lang.String operation,
                             int code)
Report a return code for a single DB operaiton.


exportMeasurements

public void exportMeasurements(MeasurementsExporter exporter)
                        throws java.io.IOException
Export the current measurements to a suitable format.

Parameters:
exporter - Exporter representing the type of format to write to.
Throws:
java.io.IOException - Thrown if the export failed.

getSummary

public java.lang.String getSummary()
Return a one line summary of the measurements.