version 1.1.2.2, 2006/04/24 19:29:05
|
version 1.1.2.3, 2006/04/27 16:11:32
|
|
|
#include <Pegasus/Common/Exception.h> | #include <Pegasus/Common/Exception.h> |
#include <Pegasus/Common/TimeValue.h> | #include <Pegasus/Common/TimeValue.h> |
#include <signal.h> | #include <signal.h> |
|
#include "Linkage.h" |
| |
#ifdef PEGASUS_OS_TYPE_WINDOWS | #ifdef PEGASUS_OS_TYPE_WINDOWS |
#include <windows.h> /* DWORD etc. */ |
// DWORD etc. |
|
#include <windows.h> |
typedef DWORD pid_t; | typedef DWORD pid_t; |
#include <process.h> /* getpid() and others. */ |
// getpid() and others. |
|
#include <process.h> |
#elif !defined(PEGASUS_OS_OS400) | #elif !defined(PEGASUS_OS_OS400) |
#include <unistd.h> | #include <unistd.h> |
#endif | #endif |
|
|
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
/** StressTest Client Status types. */ |
/** |
|
StressTest Client Status types. |
|
*/ |
enum CStatus | enum CStatus |
{ | { |
CLIENT_PASS, | CLIENT_PASS, |
|
|
CLIENT_UNKNOWN | CLIENT_UNKNOWN |
}; | }; |
| |
#ifndef PEGASUS_STRESSTESTCLIENT_LINKAGE |
|
# ifdef PEGASUS_OS_TYPE_WINDOWS |
|
# ifdef PEGASUS_STRESSTESTCLIENT_INTERNAL |
|
# define PEGASUS_STRESSTESTCLIENT_LINKAGE PEGASUS_EXPORT |
|
# else |
|
# define PEGASUS_STRESSTESTCLIENT_LINKAGE PEGASUS_IMPORT |
|
# endif |
|
# else |
|
# define PEGASUS_STRESSTESTCLIENT_LINKAGE |
|
# endif |
|
#endif |
|
|
|
/** The TestStressTestClient class holds the common functionality for all the | /** The TestStressTestClient class holds the common functionality for all the |
stress test clients. | stress test clients. |
*/ | */ |
class PEGASUS_STRESSTESTCLIENT_LINKAGE TestStressTestClient | class PEGASUS_STRESSTESTCLIENT_LINKAGE TestStressTestClient |
{ | { |
public: | public: |
/** Constructor. */ |
/** |
|
Constructor. |
|
*/ |
TestStressTestClient(); | TestStressTestClient(); |
| |
/* This method is use to get all the options that are passed through |
/** |
|
This method is used to get all the options that are passed through |
command line. | command line. |
*/ | */ |
int GetOptions( | int GetOptions( |
|
|
OptionRow* clientOptionsTable, | OptionRow* clientOptionsTable, |
Uint32 clientOptionCount); | Uint32 clientOptionCount); |
| |
/** This method is used by clients to register client specific required |
/** |
|
This method is used by clients to register client specific required |
options to the option table. All these options are taken as mandatory | options to the option table. All these options are taken as mandatory |
one. | one. |
*/ | */ |
|
|
Uint32 clientOptionCount, | Uint32 clientOptionCount, |
Uint32& totalOptionCount); | Uint32& totalOptionCount); |
| |
/** This method is used by the clients to connect to the server. If useSSL |
/** |
|
This method is used by the clients to connect to the server. If useSSL |
is true then an SSL connection will be atemped with the userName and | is true then an SSL connection will be atemped with the userName and |
passWord that is passed in. If localConnection is true a connectLocal | passWord that is passed in. If localConnection is true a connectLocal |
connection will be attempted. All parameters are required. | connection will be attempted. All parameters are required. |
|
|
Uint32 timeout, | Uint32 timeout, |
Boolean verboseTest); | Boolean verboseTest); |
| |
/** This method is used by the clients to log information which are |
/** |
|
This method is used by the clients to log information which are |
required for controller reference. It logs the inofrmation with | required for controller reference. It logs the inofrmation with |
Client ID and status of the client in the PID File log file. | Client ID and status of the client in the PID File log file. |
*/ | */ |
|
|
int clientStatus, | int clientStatus, |
String &pidFile); | String &pidFile); |
| |
/** This method is used to take the client process start time. */ |
/** |
|
This method is used to take the client process start time. |
|
*/ |
void startTime(); | void startTime(); |
| |
/** This method is used to check the time stamp for logging information |
/** |
|
This method is used to check the time stamp for logging information |
about the success or failure. | about the success or failure. |
*/ | */ |
Boolean checkTime(); | Boolean checkTime(); |
| |
/** This method is used to log the information about the client's success |
/** |
|
This method is used to log the information about the client's success |
or failure percentage at a specific interval of time. | or failure percentage at a specific interval of time. |
*/ | */ |
void logErrorPercentage( | void logErrorPercentage( |
|
|
String &clientLog, | String &clientLog, |
char client[]); | char client[]); |
| |
/** This method is used to log the informations of client logs to the |
/** |
|
This method is used to log the informations of client logs to the |
client log file. | client log file. |
*/ | */ |
void errorLog(pid_t clientPid, String &clientLog, String &message); | void errorLog(pid_t clientPid, String &clientLog, String &message); |
| |
/** Timer details. */ |
/** |
|
Timer details. |
|
*/ |
Uint64 startMilliseconds; | Uint64 startMilliseconds; |
Uint64 nowMilliseconds; | Uint64 nowMilliseconds; |
Uint64 nextCheckupInMillisecs; | Uint64 nextCheckupInMillisecs; |