webtester.packages.stats
Class usageStats

java.lang.Object
  |
  +--webtester.packages.stats.usageStats

public class usageStats
extends java.lang.Object

Gathers basic usage statistics and sends them to a hard-coded URL at sourceforge.net.

Author:
Aaron DeLong

Field Summary
private  long appExecBeginTime
          The time at which the application started.
private  long appExecEndTime
          The time at which the application finished executing.
private  float avgUrlsPerTestCase
          The average number of URLs per test case.
private  boolean bRunOnlyOnce
          Indicates whether the run only once parameter was set.
private  globalConfig gConfig
          The global configuration class.
private static int iTimeConversion
          Used to convert from milliseconds to seconds.
private  int numTestCases
          The number of test cases executed.
private  int numThreads
          The number of threads used.
private  testCaseConfig tConfig
          The test case configuration class.
private  float totalAppExecTime
          The total time it took for the application to execute.
private  int totalURLs
          The total URLs called.
 
Constructor Summary
usageStats(globalConfig configGlobal, testCaseConfig configTest)
          Constructor, which takes the configuration classes as arguments.
 
Method Summary
 float getApplicationExecTime()
          Return the total time it took for the application to execute.
private  float getAverageURLs()
          Get the average number of URLs per test case.
 void getBasicStats()
          Retrieves basic configuration information.
private  void getTotalURLs()
          Get the total number of URLs in the configuration file.
 void sendStatistics()
          Send the statistics information by calling the necessary URL.
 void setApplicationBeginTime()
          Records the time at which the application started executing.
 void setApplicationEndTime()
          Records the time at which the application stopped executing.
 void setRunOnlyOnce(boolean bVal)
          Set the value which indicates if the application is running continuously or only once.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

numTestCases

private int numTestCases
The number of test cases executed.


numThreads

private int numThreads
The number of threads used.


avgUrlsPerTestCase

private float avgUrlsPerTestCase
The average number of URLs per test case.


totalURLs

private int totalURLs
The total URLs called.


appExecBeginTime

private long appExecBeginTime
The time at which the application started.


appExecEndTime

private long appExecEndTime
The time at which the application finished executing.


totalAppExecTime

private float totalAppExecTime
The total time it took for the application to execute.


bRunOnlyOnce

private boolean bRunOnlyOnce
Indicates whether the run only once parameter was set.


gConfig

private globalConfig gConfig
The global configuration class.


tConfig

private testCaseConfig tConfig
The test case configuration class.


iTimeConversion

private static final int iTimeConversion
Used to convert from milliseconds to seconds.

See Also:
Constant Field Values
Constructor Detail

usageStats

public usageStats(globalConfig configGlobal,
                  testCaseConfig configTest)
Constructor, which takes the configuration classes as arguments.

Parameters:
configGlobal - an instance of the globalConfig class
configTest - an instance of the testCaseConfig class
Method Detail

setApplicationBeginTime

public void setApplicationBeginTime()
Records the time at which the application started executing.


setApplicationEndTime

public void setApplicationEndTime()
Records the time at which the application stopped executing.


getApplicationExecTime

public float getApplicationExecTime()
Return the total time it took for the application to execute.

Returns:
the time in seconds it took for the application to finish execution

getBasicStats

public void getBasicStats()
Retrieves basic configuration information.


getAverageURLs

private float getAverageURLs()
Get the average number of URLs per test case.

Returns:
the average number of URLs per test case

getTotalURLs

private void getTotalURLs()
Get the total number of URLs in the configuration file.


setRunOnlyOnce

public void setRunOnlyOnce(boolean bVal)
Set the value which indicates if the application is running continuously or only once.

Parameters:
bVal - boolean value which indicates TRUE or FALSE for this condition

sendStatistics

public void sendStatistics()
Send the statistics information by calling the necessary URL.