|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
// Generated automatically from 'IMessageControl.h'. DO NOT EDIT.
|
|
2
|
-
|
|
3
|
-
#pragma once
|
|
4
|
-
#include "Module.h"
|
|
5
|
-
#include "JsonData_MessageControl.h"
|
|
6
|
-
#include <interfaces/IMessageControl.h>
|
|
7
|
-
|
|
8
|
-
namespace Thunder {
|
|
9
|
-
|
|
10
|
-
namespace Exchange {
|
|
11
|
-
|
|
12
|
-
namespace JMessageControl {
|
|
13
|
-
|
|
14
|
-
namespace Version {
|
|
15
|
-
|
|
16
|
-
constexpr uint8_t Major = 1;
|
|
17
|
-
constexpr uint8_t Minor = 0;
|
|
18
|
-
constexpr uint8_t Patch = 0;
|
|
19
|
-
|
|
20
|
-
} // namespace Version
|
|
21
|
-
|
|
22
|
-
PUSH_WARNING(DISABLE_WARNING_UNUSED_FUNCTIONS)
|
|
23
|
-
PUSH_WARNING(DISABLE_WARNING_DEPRECATED_USE)
|
|
24
|
-
PUSH_WARNING(DISABLE_WARNING_TYPE_LIMITS)
|
|
25
|
-
|
|
26
|
-
template<typename MODULE>
|
|
27
|
-
static void Register(MODULE& _module__, IMessageControl* _implementation__)
|
|
28
|
-
{
|
|
29
|
-
ASSERT(_implementation__ != nullptr);
|
|
30
|
-
|
|
31
|
-
_module__.PluginHost::JSONRPC::RegisterVersion(_T("JMessageControl"), Version::Major, Version::Minor, Version::Patch);
|
|
32
|
-
|
|
33
|
-
// Register methods and properties...
|
|
34
|
-
|
|
35
|
-
// Method: 'enable' - Enables/disables a message control
|
|
36
|
-
_module__.PluginHost::JSONRPC::template Register<JsonData::MessageControl::ControlInfo, void>(_T("enable"),
|
|
37
|
-
[_implementation__](const JsonData::MessageControl::ControlInfo& params) -> uint32_t {
|
|
38
|
-
uint32_t _errorCode__ = Core::ERROR_NONE;
|
|
39
|
-
|
|
40
|
-
if ((params.IsSet() == false) || (params.IsDataValid() == false)) {
|
|
41
|
-
_errorCode__ = Core::ERROR_BAD_REQUEST;
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
const Exchange::IMessageControl::messagetype _type_{params.Type};
|
|
45
|
-
const string _category_{params.Category};
|
|
46
|
-
const string _module_{params.Module};
|
|
47
|
-
const bool _enabled_{params.Enabled};
|
|
48
|
-
|
|
49
|
-
_errorCode__ = _implementation__->Enable(_type_, _category_, _module_, _enabled_);
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return (_errorCode__);
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
// Property: 'modules' - Retrieves a list of current message modules (r/o)
|
|
57
|
-
_module__.PluginHost::JSONRPC::template Register<void, Core::JSON::ArrayType<Core::JSON::String>>(_T("modules"),
|
|
58
|
-
[_implementation__](Core::JSON::ArrayType<Core::JSON::String>& result) -> uint32_t {
|
|
59
|
-
uint32_t _errorCode__ = Core::ERROR_NONE;
|
|
60
|
-
|
|
61
|
-
::Thunder::RPC::IIteratorType<string, RPC::ID_STRINGITERATOR>* _result_{};
|
|
62
|
-
|
|
63
|
-
_errorCode__ = _implementation__->Modules(_result_);
|
|
64
|
-
|
|
65
|
-
if (_errorCode__ == Core::ERROR_NONE) {
|
|
66
|
-
result.Set(true);
|
|
67
|
-
|
|
68
|
-
if (_result_ != nullptr) {
|
|
69
|
-
string _resultItem__{};
|
|
70
|
-
while (_result_->Next(_resultItem__) == true) { result.Add() = _resultItem__; }
|
|
71
|
-
_result_->Release();
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return (_errorCode__);
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
// Indexed Property: 'controls' - Retrieves a list of current message controls for a specific module (r/o)
|
|
79
|
-
_module__.PluginHost::JSONRPC::template Register<void, Core::JSON::ArrayType<JsonData::MessageControl::ControlInfo>, std::function<uint32_t(const string&, Core::JSON::ArrayType<JsonData::MessageControl::ControlInfo>&)>>(_T("controls"),
|
|
80
|
-
[_implementation__](const string& module, Core::JSON::ArrayType<JsonData::MessageControl::ControlInfo>& result) -> uint32_t {
|
|
81
|
-
uint32_t _errorCode__ = Core::ERROR_NONE;
|
|
82
|
-
|
|
83
|
-
if (module.empty() == true) {
|
|
84
|
-
_errorCode__ = Core::ERROR_BAD_REQUEST;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
if (_errorCode__ == Core::ERROR_NONE) {
|
|
88
|
-
::Thunder::RPC::IIteratorType<IMessageControl::Control, ID_MESSAGE_CONTROL_ITERATOR>* _result_{};
|
|
89
|
-
|
|
90
|
-
_errorCode__ = _implementation__->Controls(module, _result_);
|
|
91
|
-
|
|
92
|
-
if (_errorCode__ == Core::ERROR_NONE) {
|
|
93
|
-
result.Set(true);
|
|
94
|
-
|
|
95
|
-
if (_result_ != nullptr) {
|
|
96
|
-
Exchange::IMessageControl::Control _resultItem__{};
|
|
97
|
-
while (_result_->Next(_resultItem__) == true) { result.Add() = _resultItem__; }
|
|
98
|
-
_result_->Release();
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
return (_errorCode__);
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
template<typename MODULE>
|
|
109
|
-
static void Unregister(MODULE& _module__)
|
|
110
|
-
{
|
|
111
|
-
// Unregister methods and properties...
|
|
112
|
-
_module__.PluginHost::JSONRPC::Unregister(_T("enable"));
|
|
113
|
-
_module__.PluginHost::JSONRPC::Unregister(_T("modules"));
|
|
114
|
-
_module__.PluginHost::JSONRPC::Unregister(_T("controls"));
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
POP_WARNING()
|
|
118
|
-
POP_WARNING()
|
|
119
|
-
POP_WARNING()
|
|
120
|
-
|
|
121
|
-
} // namespace JMessageControl
|
|
122
|
-
|
|
123
|
-
} // namespace Exchange
|
|
124
|
-
|
|
125
|
-
} // namespace Thunder
|
|
126
|
-
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
// C++ types for MessageControl API.
|
|
2
|
-
// Generated automatically from 'IMessageControl.h'. DO NOT EDIT.
|
|
3
|
-
|
|
4
|
-
// Note: This code is inherently not thread safe. If required, proper synchronisation must be added.
|
|
5
|
-
|
|
6
|
-
#pragma once
|
|
7
|
-
|
|
8
|
-
#include <core/JSON.h>
|
|
9
|
-
#include <interfaces/IMessageControl.h>
|
|
10
|
-
|
|
11
|
-
namespace Thunder {
|
|
12
|
-
|
|
13
|
-
namespace JsonData {
|
|
14
|
-
|
|
15
|
-
PUSH_WARNING(DISABLE_WARNING_TYPE_LIMITS)
|
|
16
|
-
|
|
17
|
-
namespace MessageControl {
|
|
18
|
-
|
|
19
|
-
// Common classes
|
|
20
|
-
//
|
|
21
|
-
|
|
22
|
-
class ControlInfo : public Core::JSON::Container {
|
|
23
|
-
public:
|
|
24
|
-
ControlInfo()
|
|
25
|
-
: Core::JSON::Container()
|
|
26
|
-
{
|
|
27
|
-
_Init();
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
ControlInfo(const ControlInfo& _other)
|
|
31
|
-
: Core::JSON::Container()
|
|
32
|
-
, Type(_other.Type)
|
|
33
|
-
, Category(_other.Category)
|
|
34
|
-
, Module(_other.Module)
|
|
35
|
-
, Enabled(_other.Enabled)
|
|
36
|
-
{
|
|
37
|
-
_Init();
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
ControlInfo(ControlInfo&& _other) noexcept
|
|
41
|
-
: Core::JSON::Container()
|
|
42
|
-
, Type(std::move(_other.Type))
|
|
43
|
-
, Category(std::move(_other.Category))
|
|
44
|
-
, Module(std::move(_other.Module))
|
|
45
|
-
, Enabled(std::move(_other.Enabled))
|
|
46
|
-
{
|
|
47
|
-
_Init();
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
ControlInfo(const Exchange::IMessageControl::Control& _other)
|
|
51
|
-
: Core::JSON::Container()
|
|
52
|
-
{
|
|
53
|
-
Type = _other.type;
|
|
54
|
-
Category = _other.category;
|
|
55
|
-
Module = _other.module;
|
|
56
|
-
Enabled = _other.enabled;
|
|
57
|
-
_Init();
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
ControlInfo& operator=(const ControlInfo& _rhs)
|
|
61
|
-
{
|
|
62
|
-
Type = _rhs.Type;
|
|
63
|
-
Category = _rhs.Category;
|
|
64
|
-
Module = _rhs.Module;
|
|
65
|
-
Enabled = _rhs.Enabled;
|
|
66
|
-
return (*this);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
ControlInfo& operator=(ControlInfo&& _rhs) noexcept
|
|
70
|
-
{
|
|
71
|
-
Type = std::move(_rhs.Type);
|
|
72
|
-
Category = std::move(_rhs.Category);
|
|
73
|
-
Module = std::move(_rhs.Module);
|
|
74
|
-
Enabled = std::move(_rhs.Enabled);
|
|
75
|
-
return (*this);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
ControlInfo& operator=(const Exchange::IMessageControl::Control& _rhs)
|
|
79
|
-
{
|
|
80
|
-
Type = _rhs.type;
|
|
81
|
-
Category = _rhs.category;
|
|
82
|
-
Module = _rhs.module;
|
|
83
|
-
Enabled = _rhs.enabled;
|
|
84
|
-
return (*this);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
operator Exchange::IMessageControl::Control() const
|
|
88
|
-
{
|
|
89
|
-
Exchange::IMessageControl::Control _value{};
|
|
90
|
-
_value.type = Type;
|
|
91
|
-
_value.category = Category;
|
|
92
|
-
_value.module = Module;
|
|
93
|
-
_value.enabled = Enabled;
|
|
94
|
-
return (_value);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
~ControlInfo() = default;
|
|
98
|
-
|
|
99
|
-
public:
|
|
100
|
-
bool IsDataValid() const
|
|
101
|
-
{
|
|
102
|
-
return ((Type.IsSet() == true) && (Category.IsSet() == true) && (Module.IsSet() == true) && (Enabled.IsSet() == true));
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
private:
|
|
106
|
-
void _Init()
|
|
107
|
-
{
|
|
108
|
-
Add(_T("type"), &Type);
|
|
109
|
-
Add(_T("category"), &Category);
|
|
110
|
-
Add(_T("module"), &Module);
|
|
111
|
-
Add(_T("enabled"), &Enabled);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
public:
|
|
115
|
-
Core::JSON::EnumType<Exchange::IMessageControl::messagetype> Type; // Type of message
|
|
116
|
-
Core::JSON::String Category; // Name of the message category
|
|
117
|
-
Core::JSON::String Module; // Name of the module the message is originating from
|
|
118
|
-
Core::JSON::Boolean Enabled; // Denotes if the control is enabled (true) or disabled (false)
|
|
119
|
-
}; // class ControlInfo
|
|
120
|
-
|
|
121
|
-
// Method params/result classes
|
|
122
|
-
//
|
|
123
|
-
|
|
124
|
-
} // namespace MessageControl
|
|
125
|
-
|
|
126
|
-
POP_WARNING()
|
|
127
|
-
|
|
128
|
-
} // namespace JsonData
|
|
129
|
-
|
|
130
|
-
// Enum conversion handlers
|
|
131
|
-
ENUM_CONVERSION_HANDLER(Exchange::IMessageControl::messagetype)
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// Enumeration code for MessageControl API.
|
|
2
|
-
// Generated automatically from 'IMessageControl.h'.
|
|
3
|
-
|
|
4
|
-
#include <core/Enumerate.h>
|
|
5
|
-
|
|
6
|
-
#include "definitions.h"
|
|
7
|
-
#include <interfaces/IMessageControl.h>
|
|
8
|
-
#include "JsonData_MessageControl.h"
|
|
9
|
-
|
|
10
|
-
namespace Thunder {
|
|
11
|
-
|
|
12
|
-
ENUM_CONVERSION_BEGIN(Exchange::IMessageControl::messagetype)
|
|
13
|
-
{ Exchange::IMessageControl::messagetype::INVALID, _TXT("Invalid") },
|
|
14
|
-
{ Exchange::IMessageControl::messagetype::TRACING, _TXT("Tracing") },
|
|
15
|
-
{ Exchange::IMessageControl::messagetype::LOGGING, _TXT("Logging") },
|
|
16
|
-
{ Exchange::IMessageControl::messagetype::REPORTING, _TXT("Reporting") },
|
|
17
|
-
{ Exchange::IMessageControl::messagetype::OPERATIONAL_STREAM, _TXT("OperationalStream") },
|
|
18
|
-
{ Exchange::IMessageControl::messagetype::ASSERT, _TXT("Assert") },
|
|
19
|
-
{ Exchange::IMessageControl::messagetype::TELEMETRY, _TXT("Telemetry") },
|
|
20
|
-
ENUM_CONVERSION_END(Exchange::IMessageControl::messagetype)
|
|
21
|
-
|
|
22
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
// IMessageControl API
|
|
2
|
-
// Generated automatically. DO NOT EDIT.
|
|
3
|
-
|
|
4
|
-
#pragma once
|
|
5
|
-
|
|
6
|
-
#include "JsonData_MessageControl.h"
|
|
7
|
-
#include "JMessageControl.h"
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
// Generated automatically from 'IBenchmark.h'. DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
#pragma once
|
|
4
|
+
#include "Module.h"
|
|
5
|
+
#include "JsonData_Benchmark.h"
|
|
6
|
+
#include <qa_interfaces/IBenchmark.h>
|
|
7
|
+
|
|
8
|
+
namespace Thunder {
|
|
9
|
+
|
|
10
|
+
namespace QualityAssurance {
|
|
11
|
+
|
|
12
|
+
namespace JBenchmark {
|
|
13
|
+
|
|
14
|
+
namespace Version {
|
|
15
|
+
|
|
16
|
+
constexpr uint8_t Major = 2;
|
|
17
|
+
constexpr uint8_t Minor = 0;
|
|
18
|
+
constexpr uint8_t Patch = 0;
|
|
19
|
+
|
|
20
|
+
} // namespace Version
|
|
21
|
+
|
|
22
|
+
PUSH_WARNING(DISABLE_WARNING_UNUSED_FUNCTIONS)
|
|
23
|
+
PUSH_WARNING(DISABLE_WARNING_DEPRECATED_USE)
|
|
24
|
+
PUSH_WARNING(DISABLE_WARNING_TYPE_LIMITS)
|
|
25
|
+
|
|
26
|
+
template<typename MODULE>
|
|
27
|
+
static void Register(MODULE& _module__, IBenchmark* _implementation__)
|
|
28
|
+
{
|
|
29
|
+
ASSERT(_implementation__ != nullptr);
|
|
30
|
+
|
|
31
|
+
_module__.PluginHost::JSONRPC::RegisterVersion(_T("JBenchmark"), Version::Major, Version::Minor, Version::Patch);
|
|
32
|
+
|
|
33
|
+
// Register methods and properties...
|
|
34
|
+
|
|
35
|
+
// Method: 'trigger' - Run the benchmark
|
|
36
|
+
_module__.PluginHost::JSONRPC::template Register<JsonData::Benchmark::TriggerParamsData, void>(_T("trigger"),
|
|
37
|
+
[_implementation__](const JsonData::Benchmark::TriggerParamsData& params) -> uint32_t {
|
|
38
|
+
uint32_t _errorCode__ = Core::ERROR_NONE;
|
|
39
|
+
|
|
40
|
+
if ((params.IsSet() == false) || (params.IsDataValid() == false)) {
|
|
41
|
+
TRACE_GLOBAL(Trace::Error, (_T("Invalid parameters for JSON-RPC call: %s.%s"), _T("JBenchmark"), _T("trigger")));
|
|
42
|
+
_errorCode__ = Core::ERROR_BAD_REQUEST;
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
const uint32_t _iterations_{params.Iterations};
|
|
46
|
+
|
|
47
|
+
_errorCode__ = _implementation__->Trigger(_iterations_);
|
|
48
|
+
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return (_errorCode__);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
// Method: 'collectData' - Collect the results of the most recent benchmark run
|
|
55
|
+
_module__.PluginHost::JSONRPC::template Register<void, Core::JSON::ArrayType<JsonData::Benchmark::BenchmarkResultData>>(_T("collectData"),
|
|
56
|
+
[_implementation__](Core::JSON::ArrayType<JsonData::Benchmark::BenchmarkResultData>& report) -> uint32_t {
|
|
57
|
+
uint32_t _errorCode__ = Core::ERROR_NONE;
|
|
58
|
+
|
|
59
|
+
::Thunder::RPC::IIteratorType<IBenchmark::BenchmarkResult, ID_BENCHMARK_RESULT_ITERATOR>* _report_{};
|
|
60
|
+
|
|
61
|
+
_errorCode__ = _implementation__->CollectData(_report_);
|
|
62
|
+
|
|
63
|
+
if (_errorCode__ == Core::ERROR_NONE) {
|
|
64
|
+
report.Set(true);
|
|
65
|
+
|
|
66
|
+
if (_report_ != nullptr) {
|
|
67
|
+
QualityAssurance::IBenchmark::BenchmarkResult _resultItem__{};
|
|
68
|
+
while (_report_->Next(_resultItem__) == true) { report.Add() = _resultItem__; }
|
|
69
|
+
_report_->Release();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return (_errorCode__);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
// Property: 'latencyThreshold' - Maximum allowed deviation in avg latency compared to first-run baseline, in millipercent (1000 = 1%, 0 = no latency check)
|
|
77
|
+
_module__.PluginHost::JSONRPC::template Register<JsonData::Benchmark::LatencyThresholdData, Core::JSON::DecUInt32>(_T("latencyThreshold"),
|
|
78
|
+
[_implementation__](const JsonData::Benchmark::LatencyThresholdData& params, Core::JSON::DecUInt32& result) -> uint32_t {
|
|
79
|
+
uint32_t _errorCode__ = Core::ERROR_NONE;
|
|
80
|
+
|
|
81
|
+
if (params.IsSet() == false) {
|
|
82
|
+
uint32_t _result_{};
|
|
83
|
+
|
|
84
|
+
_errorCode__ = (static_cast<const IBenchmark*>(_implementation__))->LatencyThreshold(_result_);
|
|
85
|
+
|
|
86
|
+
if (_errorCode__ == Core::ERROR_NONE) {
|
|
87
|
+
result = _result_;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
|
|
92
|
+
if (params.IsDataValid() == false) {
|
|
93
|
+
TRACE_GLOBAL(Trace::Error, (_T("Invalid parameters for JSON-RPC call: %s.%s"), _T("JBenchmark"), _T("latencyThreshold")));
|
|
94
|
+
_errorCode__ = Core::ERROR_BAD_REQUEST;
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
const uint32_t _value_{params.Value};
|
|
98
|
+
|
|
99
|
+
_errorCode__ = _implementation__->LatencyThreshold(_value_);
|
|
100
|
+
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
result.Null(true);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return (_errorCode__);
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
// Property: 'memoryThreshold' - Maximum allowed RSS growth in bytes per method (0 = no memory check)
|
|
110
|
+
_module__.PluginHost::JSONRPC::template Register<JsonData::Benchmark::MemoryThresholdData, Core::JSON::DecUInt64>(_T("memoryThreshold"),
|
|
111
|
+
[_implementation__](const JsonData::Benchmark::MemoryThresholdData& params, Core::JSON::DecUInt64& result) -> uint32_t {
|
|
112
|
+
uint32_t _errorCode__ = Core::ERROR_NONE;
|
|
113
|
+
|
|
114
|
+
if (params.IsSet() == false) {
|
|
115
|
+
uint64_t _result_{};
|
|
116
|
+
|
|
117
|
+
_errorCode__ = (static_cast<const IBenchmark*>(_implementation__))->MemoryThreshold(_result_);
|
|
118
|
+
|
|
119
|
+
if (_errorCode__ == Core::ERROR_NONE) {
|
|
120
|
+
result = _result_;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
|
|
125
|
+
if (params.IsDataValid() == false) {
|
|
126
|
+
TRACE_GLOBAL(Trace::Error, (_T("Invalid parameters for JSON-RPC call: %s.%s"), _T("JBenchmark"), _T("memoryThreshold")));
|
|
127
|
+
_errorCode__ = Core::ERROR_BAD_REQUEST;
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
const uint64_t _value_{params.Value};
|
|
131
|
+
|
|
132
|
+
_errorCode__ = _implementation__->MemoryThreshold(_value_);
|
|
133
|
+
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
result.Null(true);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return (_errorCode__);
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
template<typename MODULE>
|
|
145
|
+
static void Unregister(MODULE& _module__)
|
|
146
|
+
{
|
|
147
|
+
// Unregister methods and properties...
|
|
148
|
+
_module__.PluginHost::JSONRPC::Unregister(_T("trigger"));
|
|
149
|
+
_module__.PluginHost::JSONRPC::Unregister(_T("collectData"));
|
|
150
|
+
_module__.PluginHost::JSONRPC::Unregister(_T("latencyThreshold"));
|
|
151
|
+
_module__.PluginHost::JSONRPC::Unregister(_T("memoryThreshold"));
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
namespace Event {
|
|
155
|
+
|
|
156
|
+
// Event: 'performanceCheckCompleted'
|
|
157
|
+
template<typename MODULE>
|
|
158
|
+
static void PerformanceCheckCompleted(const MODULE& module_, typename MODULE::SendIfMethod sendIfMethod_ = nullptr)
|
|
159
|
+
{
|
|
160
|
+
module_.Notify(_T("performanceCheckCompleted"), sendIfMethod_);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
} // namespace Event
|
|
164
|
+
|
|
165
|
+
POP_WARNING()
|
|
166
|
+
POP_WARNING()
|
|
167
|
+
POP_WARNING()
|
|
168
|
+
|
|
169
|
+
} // namespace JBenchmark
|
|
170
|
+
|
|
171
|
+
} // namespace QualityAssurance
|
|
172
|
+
|
|
173
|
+
} // namespace Thunder
|
|
174
|
+
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
// Generated automatically from 'ITestPlugin.h'. DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
#pragma once
|
|
4
|
+
#include "Module.h"
|
|
5
|
+
#include "JsonData_TestPlugin.h"
|
|
6
|
+
#include <qa_interfaces/ITestPlugin.h>
|
|
7
|
+
|
|
8
|
+
namespace Thunder {
|
|
9
|
+
|
|
10
|
+
namespace QualityAssurance {
|
|
11
|
+
|
|
12
|
+
namespace JTestPlugin {
|
|
13
|
+
|
|
14
|
+
namespace Version {
|
|
15
|
+
|
|
16
|
+
constexpr uint8_t Major = 1;
|
|
17
|
+
constexpr uint8_t Minor = 0;
|
|
18
|
+
constexpr uint8_t Patch = 0;
|
|
19
|
+
|
|
20
|
+
} // namespace Version
|
|
21
|
+
|
|
22
|
+
PUSH_WARNING(DISABLE_WARNING_UNUSED_FUNCTIONS)
|
|
23
|
+
PUSH_WARNING(DISABLE_WARNING_DEPRECATED_USE)
|
|
24
|
+
PUSH_WARNING(DISABLE_WARNING_TYPE_LIMITS)
|
|
25
|
+
|
|
26
|
+
template<typename MODULE>
|
|
27
|
+
static void Register(MODULE& _module__, ITestPlugin* _implementation__)
|
|
28
|
+
{
|
|
29
|
+
ASSERT(_implementation__ != nullptr);
|
|
30
|
+
|
|
31
|
+
_module__.PluginHost::JSONRPC::RegisterVersion(_T("JTestPlugin"), Version::Major, Version::Minor, Version::Patch);
|
|
32
|
+
|
|
33
|
+
// Register methods and properties...
|
|
34
|
+
|
|
35
|
+
// Method: 'echo'
|
|
36
|
+
_module__.PluginHost::JSONRPC::template Register<JsonData::TestPlugin::EchoParamsData, Core::JSON::String>(_T("echo"),
|
|
37
|
+
[_implementation__](const JsonData::TestPlugin::EchoParamsData& params, Core::JSON::String& output) -> uint32_t {
|
|
38
|
+
uint32_t _errorCode__ = Core::ERROR_NONE;
|
|
39
|
+
|
|
40
|
+
if ((params.IsSet() == false) || (params.IsDataValid() == false)) {
|
|
41
|
+
TRACE_GLOBAL(Trace::Error, (_T("Invalid parameters for JSON-RPC call: %s.%s"), _T("JTestPlugin"), _T("echo")));
|
|
42
|
+
_errorCode__ = Core::ERROR_BAD_REQUEST;
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
const string _input_{params.Input};
|
|
46
|
+
string _output_{};
|
|
47
|
+
|
|
48
|
+
_errorCode__ = _implementation__->Echo(_input_, _output_);
|
|
49
|
+
|
|
50
|
+
if (_errorCode__ == Core::ERROR_NONE) {
|
|
51
|
+
output = _output_;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return (_errorCode__);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
// Method: 'greet'
|
|
59
|
+
_module__.PluginHost::JSONRPC::template Register<JsonData::TestPlugin::GreetParamsData, Core::JSON::String>(_T("greet"),
|
|
60
|
+
[_implementation__](const JsonData::TestPlugin::GreetParamsData& params, Core::JSON::String& message) -> uint32_t {
|
|
61
|
+
uint32_t _errorCode__ = Core::ERROR_NONE;
|
|
62
|
+
|
|
63
|
+
if ((params.IsSet() == false) || (params.IsDataValid() == false)) {
|
|
64
|
+
TRACE_GLOBAL(Trace::Error, (_T("Invalid parameters for JSON-RPC call: %s.%s"), _T("JTestPlugin"), _T("greet")));
|
|
65
|
+
_errorCode__ = Core::ERROR_BAD_REQUEST;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
const string _name_{params.Name};
|
|
69
|
+
string _message_{};
|
|
70
|
+
|
|
71
|
+
_errorCode__ = _implementation__->Greet(_name_, _message_);
|
|
72
|
+
|
|
73
|
+
if (_errorCode__ == Core::ERROR_NONE) {
|
|
74
|
+
message = _message_;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return (_errorCode__);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
template<typename MODULE>
|
|
84
|
+
static void Unregister(MODULE& _module__)
|
|
85
|
+
{
|
|
86
|
+
// Unregister methods and properties...
|
|
87
|
+
_module__.PluginHost::JSONRPC::Unregister(_T("echo"));
|
|
88
|
+
_module__.PluginHost::JSONRPC::Unregister(_T("greet"));
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
namespace Event {
|
|
92
|
+
|
|
93
|
+
// Event: 'onGreeting'
|
|
94
|
+
template<typename MODULE>
|
|
95
|
+
static void OnGreeting(const MODULE& module_, const JsonData::TestPlugin::OnGreetingParamsData& params, typename MODULE::SendIfMethod sendIfMethod_ = nullptr)
|
|
96
|
+
{
|
|
97
|
+
module_.Notify(_T("onGreeting"), params, sendIfMethod_);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Event: 'onGreeting'
|
|
101
|
+
template<typename MODULE>
|
|
102
|
+
static void OnGreeting(const MODULE& module_, const Core::JSON::String& message, typename MODULE::SendIfMethod sendIfMethod_ = nullptr)
|
|
103
|
+
{
|
|
104
|
+
JsonData::TestPlugin::OnGreetingParamsData params_;
|
|
105
|
+
params_.Message = message;
|
|
106
|
+
|
|
107
|
+
OnGreeting(module_, params_, sendIfMethod_);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// Event: 'onGreeting'
|
|
111
|
+
template<typename MODULE>
|
|
112
|
+
static void OnGreeting(const MODULE& module_, const string& message, typename MODULE::SendIfMethod sendIfMethod_ = nullptr)
|
|
113
|
+
{
|
|
114
|
+
JsonData::TestPlugin::OnGreetingParamsData params_;
|
|
115
|
+
params_.Message = message;
|
|
116
|
+
|
|
117
|
+
OnGreeting(module_, params_, sendIfMethod_);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
} // namespace Event
|
|
121
|
+
|
|
122
|
+
POP_WARNING()
|
|
123
|
+
POP_WARNING()
|
|
124
|
+
POP_WARNING()
|
|
125
|
+
|
|
126
|
+
} // namespace JTestPlugin
|
|
127
|
+
|
|
128
|
+
} // namespace QualityAssurance
|
|
129
|
+
|
|
130
|
+
} // namespace Thunder
|
|
131
|
+
|
|
@@ -0,0 +1,437 @@
|
|
|
1
|
+
// C++ types for Benchmark API.
|
|
2
|
+
// Generated automatically from 'IBenchmark.h'. DO NOT EDIT.
|
|
3
|
+
|
|
4
|
+
// Note: This code is inherently not thread safe. If required, proper synchronisation must be added.
|
|
5
|
+
|
|
6
|
+
#pragma once
|
|
7
|
+
|
|
8
|
+
#include <core/JSON.h>
|
|
9
|
+
#include <qa_interfaces/IBenchmark.h>
|
|
10
|
+
|
|
11
|
+
namespace Thunder {
|
|
12
|
+
|
|
13
|
+
namespace JsonData {
|
|
14
|
+
|
|
15
|
+
PUSH_WARNING(DISABLE_WARNING_TYPE_LIMITS)
|
|
16
|
+
|
|
17
|
+
namespace Benchmark {
|
|
18
|
+
|
|
19
|
+
// Method params/result classes
|
|
20
|
+
//
|
|
21
|
+
|
|
22
|
+
class BenchmarkResultData : public Core::JSON::Container {
|
|
23
|
+
public:
|
|
24
|
+
class MemoryStatsData : public Core::JSON::Container {
|
|
25
|
+
public:
|
|
26
|
+
MemoryStatsData()
|
|
27
|
+
: Core::JSON::Container()
|
|
28
|
+
{
|
|
29
|
+
_Init();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
MemoryStatsData(const MemoryStatsData& _other)
|
|
33
|
+
: Core::JSON::Container()
|
|
34
|
+
, ResidentBefore(_other.ResidentBefore)
|
|
35
|
+
, ResidentAfter(_other.ResidentAfter)
|
|
36
|
+
, AllocatedBefore(_other.AllocatedBefore)
|
|
37
|
+
, AllocatedAfter(_other.AllocatedAfter)
|
|
38
|
+
{
|
|
39
|
+
_Init();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
MemoryStatsData(MemoryStatsData&& _other) noexcept
|
|
43
|
+
: Core::JSON::Container()
|
|
44
|
+
, ResidentBefore(std::move(_other.ResidentBefore))
|
|
45
|
+
, ResidentAfter(std::move(_other.ResidentAfter))
|
|
46
|
+
, AllocatedBefore(std::move(_other.AllocatedBefore))
|
|
47
|
+
, AllocatedAfter(std::move(_other.AllocatedAfter))
|
|
48
|
+
{
|
|
49
|
+
_Init();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
MemoryStatsData(const QualityAssurance::IBenchmark::MemoryStats& _other)
|
|
53
|
+
: Core::JSON::Container()
|
|
54
|
+
{
|
|
55
|
+
ResidentBefore = _other.residentBefore;
|
|
56
|
+
ResidentAfter = _other.residentAfter;
|
|
57
|
+
AllocatedBefore = _other.allocatedBefore;
|
|
58
|
+
AllocatedAfter = _other.allocatedAfter;
|
|
59
|
+
_Init();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
MemoryStatsData& operator=(const MemoryStatsData& _rhs)
|
|
63
|
+
{
|
|
64
|
+
ResidentBefore = _rhs.ResidentBefore;
|
|
65
|
+
ResidentAfter = _rhs.ResidentAfter;
|
|
66
|
+
AllocatedBefore = _rhs.AllocatedBefore;
|
|
67
|
+
AllocatedAfter = _rhs.AllocatedAfter;
|
|
68
|
+
return (*this);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
MemoryStatsData& operator=(MemoryStatsData&& _rhs) noexcept
|
|
72
|
+
{
|
|
73
|
+
ResidentBefore = std::move(_rhs.ResidentBefore);
|
|
74
|
+
ResidentAfter = std::move(_rhs.ResidentAfter);
|
|
75
|
+
AllocatedBefore = std::move(_rhs.AllocatedBefore);
|
|
76
|
+
AllocatedAfter = std::move(_rhs.AllocatedAfter);
|
|
77
|
+
return (*this);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
MemoryStatsData& operator=(const QualityAssurance::IBenchmark::MemoryStats& _rhs)
|
|
81
|
+
{
|
|
82
|
+
ResidentBefore = _rhs.residentBefore;
|
|
83
|
+
ResidentAfter = _rhs.residentAfter;
|
|
84
|
+
AllocatedBefore = _rhs.allocatedBefore;
|
|
85
|
+
AllocatedAfter = _rhs.allocatedAfter;
|
|
86
|
+
return (*this);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
operator QualityAssurance::IBenchmark::MemoryStats() const
|
|
90
|
+
{
|
|
91
|
+
QualityAssurance::IBenchmark::MemoryStats _value{};
|
|
92
|
+
_value.residentBefore = ResidentBefore;
|
|
93
|
+
_value.residentAfter = ResidentAfter;
|
|
94
|
+
_value.allocatedBefore = AllocatedBefore;
|
|
95
|
+
_value.allocatedAfter = AllocatedAfter;
|
|
96
|
+
return (_value);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
~MemoryStatsData() = default;
|
|
100
|
+
|
|
101
|
+
public:
|
|
102
|
+
bool IsDataValid() const
|
|
103
|
+
{
|
|
104
|
+
return ((ResidentBefore.IsSet() == true) && (ResidentAfter.IsSet() == true) && (AllocatedBefore.IsSet() == true) && (AllocatedAfter.IsSet() == true));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
private:
|
|
108
|
+
void _Init()
|
|
109
|
+
{
|
|
110
|
+
Add(_T("residentBefore"), &ResidentBefore);
|
|
111
|
+
Add(_T("residentAfter"), &ResidentAfter);
|
|
112
|
+
Add(_T("allocatedBefore"), &AllocatedBefore);
|
|
113
|
+
Add(_T("allocatedAfter"), &AllocatedAfter);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
public:
|
|
117
|
+
Core::JSON::DecUInt64 ResidentBefore;
|
|
118
|
+
Core::JSON::DecUInt64 ResidentAfter;
|
|
119
|
+
Core::JSON::DecUInt64 AllocatedBefore;
|
|
120
|
+
Core::JSON::DecUInt64 AllocatedAfter;
|
|
121
|
+
}; // class MemoryStatsData
|
|
122
|
+
|
|
123
|
+
class RoundTripStatsData : public Core::JSON::Container {
|
|
124
|
+
public:
|
|
125
|
+
RoundTripStatsData()
|
|
126
|
+
: Core::JSON::Container()
|
|
127
|
+
{
|
|
128
|
+
_Init();
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
RoundTripStatsData(const RoundTripStatsData& _other)
|
|
132
|
+
: Core::JSON::Container()
|
|
133
|
+
, MinNs(_other.MinNs)
|
|
134
|
+
, AvgNs(_other.AvgNs)
|
|
135
|
+
, MaxNs(_other.MaxNs)
|
|
136
|
+
, StddevNs(_other.StddevNs)
|
|
137
|
+
{
|
|
138
|
+
_Init();
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
RoundTripStatsData(RoundTripStatsData&& _other) noexcept
|
|
142
|
+
: Core::JSON::Container()
|
|
143
|
+
, MinNs(std::move(_other.MinNs))
|
|
144
|
+
, AvgNs(std::move(_other.AvgNs))
|
|
145
|
+
, MaxNs(std::move(_other.MaxNs))
|
|
146
|
+
, StddevNs(std::move(_other.StddevNs))
|
|
147
|
+
{
|
|
148
|
+
_Init();
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
RoundTripStatsData(const QualityAssurance::IBenchmark::RoundTripStats& _other)
|
|
152
|
+
: Core::JSON::Container()
|
|
153
|
+
{
|
|
154
|
+
MinNs = _other.minNs;
|
|
155
|
+
AvgNs = _other.avgNs;
|
|
156
|
+
MaxNs = _other.maxNs;
|
|
157
|
+
StddevNs = _other.stddevNs;
|
|
158
|
+
_Init();
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
RoundTripStatsData& operator=(const RoundTripStatsData& _rhs)
|
|
162
|
+
{
|
|
163
|
+
MinNs = _rhs.MinNs;
|
|
164
|
+
AvgNs = _rhs.AvgNs;
|
|
165
|
+
MaxNs = _rhs.MaxNs;
|
|
166
|
+
StddevNs = _rhs.StddevNs;
|
|
167
|
+
return (*this);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
RoundTripStatsData& operator=(RoundTripStatsData&& _rhs) noexcept
|
|
171
|
+
{
|
|
172
|
+
MinNs = std::move(_rhs.MinNs);
|
|
173
|
+
AvgNs = std::move(_rhs.AvgNs);
|
|
174
|
+
MaxNs = std::move(_rhs.MaxNs);
|
|
175
|
+
StddevNs = std::move(_rhs.StddevNs);
|
|
176
|
+
return (*this);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
RoundTripStatsData& operator=(const QualityAssurance::IBenchmark::RoundTripStats& _rhs)
|
|
180
|
+
{
|
|
181
|
+
MinNs = _rhs.minNs;
|
|
182
|
+
AvgNs = _rhs.avgNs;
|
|
183
|
+
MaxNs = _rhs.maxNs;
|
|
184
|
+
StddevNs = _rhs.stddevNs;
|
|
185
|
+
return (*this);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
operator QualityAssurance::IBenchmark::RoundTripStats() const
|
|
189
|
+
{
|
|
190
|
+
QualityAssurance::IBenchmark::RoundTripStats _value{};
|
|
191
|
+
_value.minNs = MinNs;
|
|
192
|
+
_value.avgNs = AvgNs;
|
|
193
|
+
_value.maxNs = MaxNs;
|
|
194
|
+
_value.stddevNs = StddevNs;
|
|
195
|
+
return (_value);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
~RoundTripStatsData() = default;
|
|
199
|
+
|
|
200
|
+
public:
|
|
201
|
+
bool IsDataValid() const
|
|
202
|
+
{
|
|
203
|
+
return ((MinNs.IsSet() == true) && (AvgNs.IsSet() == true) && (MaxNs.IsSet() == true) && (StddevNs.IsSet() == true));
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
private:
|
|
207
|
+
void _Init()
|
|
208
|
+
{
|
|
209
|
+
Add(_T("minNs"), &MinNs);
|
|
210
|
+
Add(_T("avgNs"), &AvgNs);
|
|
211
|
+
Add(_T("maxNs"), &MaxNs);
|
|
212
|
+
Add(_T("stddevNs"), &StddevNs);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
public:
|
|
216
|
+
Core::JSON::DecUInt64 MinNs;
|
|
217
|
+
Core::JSON::DecUInt64 AvgNs;
|
|
218
|
+
Core::JSON::DecUInt64 MaxNs;
|
|
219
|
+
Core::JSON::DecUInt64 StddevNs;
|
|
220
|
+
}; // class RoundTripStatsData
|
|
221
|
+
|
|
222
|
+
BenchmarkResultData()
|
|
223
|
+
: Core::JSON::Container()
|
|
224
|
+
{
|
|
225
|
+
_Init();
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
BenchmarkResultData(const BenchmarkResultData& _other)
|
|
229
|
+
: Core::JSON::Container()
|
|
230
|
+
, ApiName(_other.ApiName)
|
|
231
|
+
, Iterations(_other.Iterations)
|
|
232
|
+
, RoundTrip(_other.RoundTrip)
|
|
233
|
+
, Memory(_other.Memory)
|
|
234
|
+
, Passed(_other.Passed)
|
|
235
|
+
, FailureReason(_other.FailureReason)
|
|
236
|
+
{
|
|
237
|
+
_Init();
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
BenchmarkResultData(BenchmarkResultData&& _other) noexcept
|
|
241
|
+
: Core::JSON::Container()
|
|
242
|
+
, ApiName(std::move(_other.ApiName))
|
|
243
|
+
, Iterations(std::move(_other.Iterations))
|
|
244
|
+
, RoundTrip(std::move(_other.RoundTrip))
|
|
245
|
+
, Memory(std::move(_other.Memory))
|
|
246
|
+
, Passed(std::move(_other.Passed))
|
|
247
|
+
, FailureReason(std::move(_other.FailureReason))
|
|
248
|
+
{
|
|
249
|
+
_Init();
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
BenchmarkResultData(const QualityAssurance::IBenchmark::BenchmarkResult& _other)
|
|
253
|
+
: Core::JSON::Container()
|
|
254
|
+
{
|
|
255
|
+
ApiName = _other.apiName;
|
|
256
|
+
Iterations = _other.iterations;
|
|
257
|
+
RoundTrip.Set(true);
|
|
258
|
+
RoundTrip = _other.roundTrip;
|
|
259
|
+
Memory.Set(true);
|
|
260
|
+
Memory = _other.memory;
|
|
261
|
+
Passed = _other.passed;
|
|
262
|
+
if (_other.failureReason.IsSet() == true) {
|
|
263
|
+
FailureReason = _other.failureReason.Value();
|
|
264
|
+
}
|
|
265
|
+
_Init();
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
BenchmarkResultData& operator=(const BenchmarkResultData& _rhs)
|
|
269
|
+
{
|
|
270
|
+
ApiName = _rhs.ApiName;
|
|
271
|
+
Iterations = _rhs.Iterations;
|
|
272
|
+
RoundTrip = _rhs.RoundTrip;
|
|
273
|
+
Memory = _rhs.Memory;
|
|
274
|
+
Passed = _rhs.Passed;
|
|
275
|
+
if (_rhs.FailureReason.IsSet() == true) {
|
|
276
|
+
FailureReason = _rhs.FailureReason;
|
|
277
|
+
}
|
|
278
|
+
return (*this);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
BenchmarkResultData& operator=(BenchmarkResultData&& _rhs) noexcept
|
|
282
|
+
{
|
|
283
|
+
ApiName = std::move(_rhs.ApiName);
|
|
284
|
+
Iterations = std::move(_rhs.Iterations);
|
|
285
|
+
RoundTrip = std::move(_rhs.RoundTrip);
|
|
286
|
+
Memory = std::move(_rhs.Memory);
|
|
287
|
+
Passed = std::move(_rhs.Passed);
|
|
288
|
+
FailureReason = std::move(_rhs.FailureReason);
|
|
289
|
+
return (*this);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
BenchmarkResultData& operator=(const QualityAssurance::IBenchmark::BenchmarkResult& _rhs)
|
|
293
|
+
{
|
|
294
|
+
ApiName = _rhs.apiName;
|
|
295
|
+
Iterations = _rhs.iterations;
|
|
296
|
+
RoundTrip.Set(true);
|
|
297
|
+
RoundTrip = _rhs.roundTrip;
|
|
298
|
+
Memory.Set(true);
|
|
299
|
+
Memory = _rhs.memory;
|
|
300
|
+
Passed = _rhs.passed;
|
|
301
|
+
if (_rhs.failureReason.IsSet() == true) {
|
|
302
|
+
FailureReason = _rhs.failureReason.Value();
|
|
303
|
+
}
|
|
304
|
+
return (*this);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
operator QualityAssurance::IBenchmark::BenchmarkResult() const
|
|
308
|
+
{
|
|
309
|
+
QualityAssurance::IBenchmark::BenchmarkResult _value{};
|
|
310
|
+
_value.apiName = ApiName;
|
|
311
|
+
_value.iterations = Iterations;
|
|
312
|
+
_value.roundTrip = RoundTrip;
|
|
313
|
+
_value.memory = Memory;
|
|
314
|
+
_value.passed = Passed;
|
|
315
|
+
if (FailureReason.IsSet() == true) {
|
|
316
|
+
_value.failureReason = FailureReason;
|
|
317
|
+
}
|
|
318
|
+
return (_value);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
~BenchmarkResultData() = default;
|
|
322
|
+
|
|
323
|
+
public:
|
|
324
|
+
bool IsDataValid() const
|
|
325
|
+
{
|
|
326
|
+
return ((ApiName.IsSet() == true) && (Iterations.IsSet() == true) && ((RoundTrip.IsSet() == true) && (RoundTrip.IsDataValid() == true)) && ((Memory.IsSet() == true) && (Memory.IsDataValid() == true)) && (Passed.IsSet() == true));
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
private:
|
|
330
|
+
void _Init()
|
|
331
|
+
{
|
|
332
|
+
Add(_T("apiName"), &ApiName);
|
|
333
|
+
Add(_T("iterations"), &Iterations);
|
|
334
|
+
Add(_T("roundTrip"), &RoundTrip);
|
|
335
|
+
Add(_T("memory"), &Memory);
|
|
336
|
+
Add(_T("passed"), &Passed);
|
|
337
|
+
Add(_T("failureReason"), &FailureReason);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
public:
|
|
341
|
+
Core::JSON::String ApiName;
|
|
342
|
+
Core::JSON::DecUInt32 Iterations;
|
|
343
|
+
BenchmarkResultData::RoundTripStatsData RoundTrip;
|
|
344
|
+
BenchmarkResultData::MemoryStatsData Memory;
|
|
345
|
+
Core::JSON::Boolean Passed;
|
|
346
|
+
Core::JSON::EnumType<QualityAssurance::IBenchmark::FailureReason> FailureReason;
|
|
347
|
+
}; // class BenchmarkResultData
|
|
348
|
+
|
|
349
|
+
class LatencyThresholdData : public Core::JSON::Container {
|
|
350
|
+
public:
|
|
351
|
+
LatencyThresholdData()
|
|
352
|
+
: Core::JSON::Container()
|
|
353
|
+
{
|
|
354
|
+
Add(_T("value"), &Value);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
LatencyThresholdData(const LatencyThresholdData&) = delete;
|
|
358
|
+
LatencyThresholdData(LatencyThresholdData&&) noexcept = delete;
|
|
359
|
+
|
|
360
|
+
LatencyThresholdData& operator=(const LatencyThresholdData&) = delete;
|
|
361
|
+
LatencyThresholdData& operator=(LatencyThresholdData&&) noexcept = delete;
|
|
362
|
+
|
|
363
|
+
~LatencyThresholdData() = default;
|
|
364
|
+
|
|
365
|
+
public:
|
|
366
|
+
bool IsDataValid() const
|
|
367
|
+
{
|
|
368
|
+
return (Value.IsSet() == true);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
public:
|
|
372
|
+
Core::JSON::DecUInt32 Value; // Maximum allowed deviation in avg latency compared to first-run baseline, in millipercent (1000 = 1%, 0 = no latency check)
|
|
373
|
+
}; // class LatencyThresholdData
|
|
374
|
+
|
|
375
|
+
class MemoryThresholdData : public Core::JSON::Container {
|
|
376
|
+
public:
|
|
377
|
+
MemoryThresholdData()
|
|
378
|
+
: Core::JSON::Container()
|
|
379
|
+
{
|
|
380
|
+
Add(_T("value"), &Value);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
MemoryThresholdData(const MemoryThresholdData&) = delete;
|
|
384
|
+
MemoryThresholdData(MemoryThresholdData&&) noexcept = delete;
|
|
385
|
+
|
|
386
|
+
MemoryThresholdData& operator=(const MemoryThresholdData&) = delete;
|
|
387
|
+
MemoryThresholdData& operator=(MemoryThresholdData&&) noexcept = delete;
|
|
388
|
+
|
|
389
|
+
~MemoryThresholdData() = default;
|
|
390
|
+
|
|
391
|
+
public:
|
|
392
|
+
bool IsDataValid() const
|
|
393
|
+
{
|
|
394
|
+
return (Value.IsSet() == true);
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
public:
|
|
398
|
+
Core::JSON::DecUInt64 Value; // Maximum allowed RSS growth in bytes per method (0 = no memory check)
|
|
399
|
+
}; // class MemoryThresholdData
|
|
400
|
+
|
|
401
|
+
class TriggerParamsData : public Core::JSON::Container {
|
|
402
|
+
public:
|
|
403
|
+
TriggerParamsData()
|
|
404
|
+
: Core::JSON::Container()
|
|
405
|
+
{
|
|
406
|
+
Add(_T("iterations"), &Iterations);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
TriggerParamsData(const TriggerParamsData&) = delete;
|
|
410
|
+
TriggerParamsData(TriggerParamsData&&) noexcept = delete;
|
|
411
|
+
|
|
412
|
+
TriggerParamsData& operator=(const TriggerParamsData&) = delete;
|
|
413
|
+
TriggerParamsData& operator=(TriggerParamsData&&) noexcept = delete;
|
|
414
|
+
|
|
415
|
+
~TriggerParamsData() = default;
|
|
416
|
+
|
|
417
|
+
public:
|
|
418
|
+
bool IsDataValid() const
|
|
419
|
+
{
|
|
420
|
+
return (Iterations.IsSet() == true);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
public:
|
|
424
|
+
Core::JSON::DecUInt32 Iterations; // Denotes the number of iterations the benchmark should run
|
|
425
|
+
}; // class TriggerParamsData
|
|
426
|
+
|
|
427
|
+
} // namespace Benchmark
|
|
428
|
+
|
|
429
|
+
POP_WARNING()
|
|
430
|
+
|
|
431
|
+
} // namespace JsonData
|
|
432
|
+
|
|
433
|
+
// Enum conversion handlers
|
|
434
|
+
ENUM_CONVERSION_HANDLER(QualityAssurance::IBenchmark::FailureReason)
|
|
435
|
+
|
|
436
|
+
}
|
|
437
|
+
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
// C++ types for Test API.
|
|
2
|
+
// Generated automatically from 'ITestPlugin.h'. DO NOT EDIT.
|
|
3
|
+
|
|
4
|
+
// Note: This code is inherently not thread safe. If required, proper synchronisation must be added.
|
|
5
|
+
|
|
6
|
+
#pragma once
|
|
7
|
+
|
|
8
|
+
#include <core/JSON.h>
|
|
9
|
+
#include <qa_interfaces/ITestPlugin.h>
|
|
10
|
+
|
|
11
|
+
namespace Thunder {
|
|
12
|
+
|
|
13
|
+
namespace JsonData {
|
|
14
|
+
|
|
15
|
+
PUSH_WARNING(DISABLE_WARNING_TYPE_LIMITS)
|
|
16
|
+
|
|
17
|
+
namespace TestPlugin {
|
|
18
|
+
|
|
19
|
+
// Method params/result classes
|
|
20
|
+
//
|
|
21
|
+
|
|
22
|
+
class EchoParamsData : public Core::JSON::Container {
|
|
23
|
+
public:
|
|
24
|
+
EchoParamsData()
|
|
25
|
+
: Core::JSON::Container()
|
|
26
|
+
{
|
|
27
|
+
Add(_T("input"), &Input);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
EchoParamsData(const EchoParamsData&) = delete;
|
|
31
|
+
EchoParamsData(EchoParamsData&&) noexcept = delete;
|
|
32
|
+
|
|
33
|
+
EchoParamsData& operator=(const EchoParamsData&) = delete;
|
|
34
|
+
EchoParamsData& operator=(EchoParamsData&&) noexcept = delete;
|
|
35
|
+
|
|
36
|
+
~EchoParamsData() = default;
|
|
37
|
+
|
|
38
|
+
public:
|
|
39
|
+
bool IsDataValid() const
|
|
40
|
+
{
|
|
41
|
+
return (Input.IsSet() == true);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
public:
|
|
45
|
+
Core::JSON::String Input;
|
|
46
|
+
}; // class EchoParamsData
|
|
47
|
+
|
|
48
|
+
class GreetParamsData : public Core::JSON::Container {
|
|
49
|
+
public:
|
|
50
|
+
GreetParamsData()
|
|
51
|
+
: Core::JSON::Container()
|
|
52
|
+
{
|
|
53
|
+
Add(_T("name"), &Name);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
GreetParamsData(const GreetParamsData&) = delete;
|
|
57
|
+
GreetParamsData(GreetParamsData&&) noexcept = delete;
|
|
58
|
+
|
|
59
|
+
GreetParamsData& operator=(const GreetParamsData&) = delete;
|
|
60
|
+
GreetParamsData& operator=(GreetParamsData&&) noexcept = delete;
|
|
61
|
+
|
|
62
|
+
~GreetParamsData() = default;
|
|
63
|
+
|
|
64
|
+
public:
|
|
65
|
+
bool IsDataValid() const
|
|
66
|
+
{
|
|
67
|
+
return (Name.IsSet() == true);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
public:
|
|
71
|
+
Core::JSON::String Name;
|
|
72
|
+
}; // class GreetParamsData
|
|
73
|
+
|
|
74
|
+
class OnGreetingParamsData : public Core::JSON::Container {
|
|
75
|
+
public:
|
|
76
|
+
OnGreetingParamsData()
|
|
77
|
+
: Core::JSON::Container()
|
|
78
|
+
{
|
|
79
|
+
Add(_T("message"), &Message);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
OnGreetingParamsData(const OnGreetingParamsData&) = delete;
|
|
83
|
+
OnGreetingParamsData(OnGreetingParamsData&&) noexcept = delete;
|
|
84
|
+
|
|
85
|
+
OnGreetingParamsData& operator=(const OnGreetingParamsData&) = delete;
|
|
86
|
+
OnGreetingParamsData& operator=(OnGreetingParamsData&&) noexcept = delete;
|
|
87
|
+
|
|
88
|
+
~OnGreetingParamsData() = default;
|
|
89
|
+
|
|
90
|
+
public:
|
|
91
|
+
bool IsDataValid() const
|
|
92
|
+
{
|
|
93
|
+
return (Message.IsSet() == true);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
public:
|
|
97
|
+
Core::JSON::String Message;
|
|
98
|
+
}; // class OnGreetingParamsData
|
|
99
|
+
|
|
100
|
+
} // namespace TestPlugin
|
|
101
|
+
|
|
102
|
+
POP_WARNING()
|
|
103
|
+
|
|
104
|
+
} // namespace JsonData
|
|
105
|
+
|
|
106
|
+
}
|
|
107
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Enumeration code for Benchmark API.
|
|
2
|
+
// Generated automatically from 'IBenchmark.h'.
|
|
3
|
+
|
|
4
|
+
#include <core/Enumerate.h>
|
|
5
|
+
|
|
6
|
+
#include "definitions.h"
|
|
7
|
+
#include <qa_interfaces/IBenchmark.h>
|
|
8
|
+
#include "JsonData_Benchmark.h"
|
|
9
|
+
|
|
10
|
+
namespace Thunder {
|
|
11
|
+
|
|
12
|
+
ENUM_CONVERSION_BEGIN(QualityAssurance::IBenchmark::FailureReason)
|
|
13
|
+
{ QualityAssurance::IBenchmark::FailureReason::LATENCY_THRESHOLD_EXCEEDED, _TXT("LATENCY_THRESHOLD_EXCEEDED") },
|
|
14
|
+
{ QualityAssurance::IBenchmark::FailureReason::MEMORY_THRESHOLD_EXCEEDED, _TXT("MEMORY_THRESHOLD_EXCEEDED") },
|
|
15
|
+
{ QualityAssurance::IBenchmark::FailureReason::LATENCY_AND_MEMORY_THRESHOLD_EXCEEDED, _TXT("LATENCY_AND_MEMORY_THRESHOLD_EXCEEDED") },
|
|
16
|
+
ENUM_CONVERSION_END(QualityAssurance::IBenchmark::FailureReason)
|
|
17
|
+
|
|
18
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// IBenchmark API
|
|
2
|
+
// Generated automatically. DO NOT EDIT.
|
|
3
|
+
|
|
4
|
+
#pragma once
|
|
5
|
+
|
|
6
|
+
#include "JsonData_Benchmark.h"
|
|
7
|
+
#include "JBenchmark.h"
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// ITestPlugin API
|
|
2
|
+
// Generated automatically. DO NOT EDIT.
|
|
3
|
+
|
|
4
|
+
#pragma once
|
|
5
|
+
|
|
6
|
+
#include "JsonData_TestPlugin.h"
|
|
7
|
+
#include "JTestPlugin.h"
|