hce-node application  1.4.3
HCE Hierarchical Cluster Engine node application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
DRCEStressTest.hpp
Go to the documentation of this file.
1 
14 #ifndef DRCE_STRESS_TEST_HPP
15 #define DRCE_STRESS_TEST_HPP
16 
17 #include <iostream>
18 #include <string>
19 #include <map>
20 
21 #include "DRCEFunctionalObject.hpp"
22 #include "DRCESessionOptions.hpp"
23 #include "DRCEResourceLimits.hpp"
28 
29 namespace HCE
30 {
31 namespace drce
32 {
33 namespace tests
34 {
35 //-----------------------------------------------------------------------------
37 {
38 public:
39  static void testMultipleRequests(DRCEFunctionalObject& fObj, SessionOptions::SessionType sessionType, unsigned int requestCount);
40  static void testRequestsTimeDelay(DRCEFunctionalObject& fObj, SessionOptions::SessionType sessionType, unsigned int requestCount, unsigned int repeat);
43 
44 private:
45  static void testResourceLimits(DRCEFunctionalObject& fObj,
46  SessionOptions::SessionType sessionType,
47  SessionOptions::ThreadMode threadMode,
49  unsigned int& taskId,
50  bool exceededLimits,
51  const std::string& commandLine="");
52 
53  static void testRequestsTimeDelay(DRCEFunctionalObject& fObj, SessionOptions::SessionType sessionType, unsigned int requestCount, unsigned int& taskId,
54  std::map<unsigned int, unsigned int>& delayTimes, std::map<unsigned int, unsigned int>& times);
55  static unsigned int getRequestTime(DRCEFunctionalObject& fObj, unsigned int requestId);
56 
57  static void executeRequest(DRCEFunctionalObject& fObj, const std::string& json);
58  static std::string getJsonRequestSetExecute(DRCETaskRequestSetExecute& requestSetExecute, unsigned int requestId);
59 
60  static std::string getJsonRequestSetExecuteAsyncExpitedTask(SessionOptions::SessionType sessionType,unsigned int requestId);
61  static std::string getJsonRequestSetExecuteAsyncLongTask(SessionOptions::SessionType sessionType,unsigned int requestId);
62  static std::string getJsonRequestSetExecuteAsyncShortTask(SessionOptions::SessionType sessionType,unsigned int requestId);
63  static std::string getJsonRequestSetExecuteSyncShortTask(SessionOptions::SessionType sessionType,unsigned int requestId);
64 
65 
66  static std::string generateJsonRequest(unsigned int caseNumber, unsigned int requestId);
67  static std::string getJsonRequestCheckState(DRCETaskRequestCheckState::CheckType checkType, unsigned int requestId);
68  static std::string getJsonRequestGetData(DRCETaskRequestGetData::FetchType fetchType, unsigned int requestId);
69  static std::string getJsonRequestTerminate(DRCETaskRequestTerminate::AlgorithmType algorithmType, unsigned int requestId);
70 
71  static std::string getJsonRequestResourceLimits(SessionOptions::SessionType sessionType,
72  SessionOptions::ThreadMode threadMode,
73  unsigned int requestId,
74  const ResourceLimits& resourceLimits,
75  const std::string& commandLine="");
76 };
77 //-----------------------------------------------------------------------------
78 //-----------------------------------------------------------------------------
79 } // end namespace tests
80 } // end namespace drce
81 } // end namespace HCE
82 
83 #endif // DRCE_STRESS_TEST_HPP