edu.usc.bg.measurements
Class MyMeasurement

java.lang.Object
  extended by edu.usc.bg.measurements.MyMeasurement

public class MyMeasurement
extends java.lang.Object

Collects latency and rerurn code measurements, and reports them when requested.

Author:
barahman

Constructor Summary
MyMeasurement(int tid)
           
 
Method Summary
static java.lang.String getFinalResults()
          Return a one line summary of measurements of all the threads
static MyMeasurement getMeasurements(double expLatency)
          creates a measurement tracker for each thread which is not synchronized between threads
static double getSatisfyingPerc()
           
static java.lang.String getSummary()
          Return a one line summary of measurements of all the threads
 void measure(java.lang.String operation, int latency)
          Adds the latency observed for the operation
 void reportReturnCode(java.lang.String operation, int code)
          Report a return code for a single type of operation by a thread
static void resetMeasurement()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MyMeasurement

public MyMeasurement(int tid)
Method Detail

getMeasurements

public static MyMeasurement getMeasurements(double expLatency)
creates a measurement tracker for each thread which is not synchronized between threads

Returns:
MyMeasurement

measure

public void measure(java.lang.String operation,
                    int latency)
Adds the latency observed for the operation


reportReturnCode

public void reportReturnCode(java.lang.String operation,
                             int code)
Report a return code for a single type of operation by a thread


getSummary

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


getFinalResults

public static java.lang.String getFinalResults()
Return a one line summary of measurements of all the threads


getSatisfyingPerc

public static double getSatisfyingPerc()

resetMeasurement

public static void resetMeasurement()