All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class edu.vt.marian.common.PerformanceMeasurement

java.lang.Object
   |
   +----edu.vt.marian.common.PerformanceMeasurement

public class PerformanceMeasurement
extends Object
Class name: PerformanceMeasurement

Class description: this class is used to do system performance measurement, it will record time for each measurement automatically, caculate the average, and dump all the results to a file in human readable format


Variable Index

 o FILE_WRITE_ERROR
 o INVALID_ID
 o OK
possible return values of methods

Constructor Index

 o PerformanceMeasurement()
this constructor will create a PerformanceMeasurement object, there is no Measurement at this time

Method Index

 o add_measurement(String)
this will add a new measurement into this object, the return value is the id of this Measurement and can be used to do measure later
 o dump_to_file(String, boolean)
this method will dump all the result of this object so far into the file in human readable format, it will rewrite the file or append to the end of it depending on the parameter append
 o dump_to_file(String, int, boolean)
this method will dump all the result of the specified measurement so far into the file in human readable format, it will rewrite the file or append to the end of it depending on the parameter append
 o end_measure(int)
this method will record a end time for the specified measurement_id
 o start_measure(int)
this method will record a start time for the Measurement specified by the parameter measurement_id

Variables

 o OK
 public static final int OK
possible return values of methods

 o INVALID_ID
 public static final int INVALID_ID
 o FILE_WRITE_ERROR
 public static final int FILE_WRITE_ERROR

Constructors

 o PerformanceMeasurement
 public PerformanceMeasurement()
this constructor will create a PerformanceMeasurement object, there is no Measurement at this time

Methods

 o add_measurement
 public int add_measurement(String description)
this will add a new measurement into this object, the return value is the id of this Measurement and can be used to do measure later

 o start_measure
 public int start_measure(int measurement_id)
this method will record a start time for the Measurement specified by the parameter measurement_id

 o end_measure
 public int end_measure(int measurement_id)
this method will record a end time for the specified measurement_id

 o dump_to_file
 public int dump_to_file(String file_name,
                         boolean append)
this method will dump all the result of this object so far into the file in human readable format, it will rewrite the file or append to the end of it depending on the parameter append

 o dump_to_file
 public int dump_to_file(String file_name,
                         int measurement_id,
                         boolean append)
this method will dump all the result of the specified measurement so far into the file in human readable format, it will rewrite the file or append to the end of it depending on the parameter append


All Packages  Class Hierarchy  This Package  Previous  Next  Index