diff --git a/definitions/Definitions.vcxproj b/definitions/Definitions.vcxproj index 3056aedd..580cfee0 100644 --- a/definitions/Definitions.vcxproj +++ b/definitions/Definitions.vcxproj @@ -43,7 +43,6 @@ - @@ -221,18 +220,32 @@ $(ProjectDir)../interfaces/json/JSubsystemControl.h - $(ProjectDir)../interfaces/json/JPluginAsyncStateControl.h + python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force + ClInclude + python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force + ClInclude python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force ClInclude python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force + ClInclude $(ProjectDir)../interfaces/json/JPluginAsyncStateControl.h $(ProjectDir)../interfaces/json/JPluginAsyncStateControl.h + $(ProjectDir)../interfaces/json/JPluginAsyncStateControl.h $(ProjectDir)../interfaces/json/JPluginAsyncStateControl.h - python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force - python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force + + ClInclude ClInclude + ClInclude ClInclude + python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force + python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force + python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force + python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force + $(ProjectDir)../interfaces/json/JPerformance.h + $(ProjectDir)../interfaces/json/JPerformance.h + $(ProjectDir)../interfaces/json/JPerformance.h + $(ProjectDir)../interfaces/json/JPerformance.h @@ -422,9 +435,6 @@ Document - - Document - Document diff --git a/definitions/Definitions.vcxproj.filters b/definitions/Definitions.vcxproj.filters index b7cf283f..ed7357e2 100644 --- a/definitions/Definitions.vcxproj.filters +++ b/definitions/Definitions.vcxproj.filters @@ -76,9 +76,6 @@ Generated Files - - Generated Files - Generated Files @@ -224,9 +221,6 @@ JSON Files - - JSON Files - JSON Files @@ -258,6 +252,9 @@ Interface Files + + Interface Files + diff --git a/interfaces/IPerformance.h b/interfaces/IPerformance.h index 627b7f1e..56f3b704 100644 --- a/interfaces/IPerformance.h +++ b/interfaces/IPerformance.h @@ -18,18 +18,65 @@ */ #pragma once + #include "Module.h" namespace Thunder { + namespace Exchange { + // @json 1.0.0 @text:legacy_lowercase struct EXTERNAL IPerformance : virtual public Core::IUnknown { enum { ID = ID_PERFORMANCE }; - virtual uint32_t Send(const uint16_t sendSize, const uint8_t buffer[] /* @length:sendSize @in */ ) = 0; - virtual uint32_t Receive(uint16_t& bufferSize /* @inout */, uint8_t buffer[] /* @length:bufferSize @out */) const = 0; - virtual uint32_t Exchange(uint16_t& bufferSize /* @inout */, uint8_t buffer[] /* @length:bufferSize @maxlength:maxBufferSize @inout*/, const uint16_t maxBufferSize) = 0; + // @brief Test the process of sending the data + // @param sendSize: Length of the sent data (e.g. 15) + // @param buffer: Any data to be sent (e.g. HelloWorld) + virtual Core::hresult Send(const uint16_t sendSize, const uint8_t buffer[] /* @encode:base64 @length:sendSize */) = 0; + + // @brief Test the process of receiving the data + // @param bufferSize: Size of data to be provided (e.g. 10) + // @param buffer: Data with a specified length (e.g. fhrjtus4p1) + virtual Core::hresult Receive(uint16_t& bufferSize /* @inout */, uint8_t buffer[] /* @encode:base64 @length:bufferSize @maxlength:bufferSize @out */) const = 0; + + // @brief Test the process of both sending and receiving the data + // @param bufferSize: Length of the data to be both sent as well as received (e.g. 20) + // @param buffer: Data to be sent and then also received (e.g. kjrpq018rt) + // @param maxBufferSize: Maximum size of the buffer that can be received (e.g. 100) + virtual Core::hresult Exchange(uint16_t& bufferSize /* @inout */, uint8_t buffer[] /* @encode:base64 @length:bufferSize @maxlength:maxBufferSize @inout */, const uint16_t maxBufferSize) = 0; + }; + + // @json 1.0.0 @text:legacy_lowercase + struct EXTERNAL IPerformanceStatistics : virtual public Core::IUnknown { + + enum { ID = ID_PERFORMANCE_STATISTICS }; + + struct Statistics { + uint32_t minimum /* @brief Minimum value of measurements (e.g. 1) */; + uint32_t maximum /* @brief Maximum value of measurements (e.g. 4) */; + uint32_t average /* @brief Average value of measurements (e.g. 2) */; + uint32_t count /* @brief How many times measurement has been collected (e.g. 5) */; + }; + + struct Measurements { + Statistics serialization /* @brief Time taken to complete serialization */; + Statistics deserialization /* @brief Time taken to complete deserialization */; + Statistics execution /* @brief Time taken to complete execution */; + Statistics threadPool /* @brief Time taken to complete threadpool wait */; + Statistics communication /* @brief Time taken to complete communication */; + Statistics total /* @brief Time taken to complete whole JSON-RPC process */; + }; + + // @property + // @brief Retrieve the performance measurement against a given package size. Measurements will be provided in milliseconds + // @param index: Size of package which statistics info is about to be retrieved (e.g. 1000) + // @param measurement: Various performance measurements against a given package size + virtual Core::hresult Measurement(const uint32_t index /* @index */, Measurements& measurement /* @out */) const = 0; + + // @brief Clear all performance data collected so far + // @alt:deprecated clear + virtual Core::hresult Reset() = 0; }; } } diff --git a/interfaces/Ids.h b/interfaces/Ids.h index 3ff8beb2..9bc19447 100644 --- a/interfaces/Ids.h +++ b/interfaces/Ids.h @@ -188,6 +188,7 @@ namespace Exchange { ID_DSGCC_CLIENT_NOTIFICATION = ID_DSGCC_CLIENT + 1, ID_PERFORMANCE = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x230, + ID_PERFORMANCE_STATISTICS = ID_PERFORMANCE + 1, ID_WEBPA = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x240, ID_WEBPA_CLIENT = ID_WEBPA + 1, diff --git a/jsonrpc/PerformanceMonitor.json b/jsonrpc/PerformanceMonitor.json deleted file mode 100644 index 8887fbd6..00000000 --- a/jsonrpc/PerformanceMonitor.json +++ /dev/null @@ -1,157 +0,0 @@ -{ - "$schema": "interface.schema.json", - "jsonrpc": "2.0", - "info": { - "version": "1.0.0", - "title": "Performance Monitor API", - "class": "PerformanceMonitor", - "format": "uncompliant-collapsed", - "description": "Performance Monitor JSON-RPC interface" - }, - "common": { - "$ref": "common.json" - }, - "definitions": { - "time": { - "type": "number", - "size": 32 - }, - "datasize": { - "type": "number", - "size": 32 - }, - "buffer": { - "type": "object", - "properties": { - "data": { - "type": "string", - "description": "Any string data upto the size specified in the length", - "example": "abababababab" - }, - "length": { - "type": "number", - "description": "Size of the data", - "size": 16 - }, - "duration": { - "type": "number", - "description": "Duration of the measurements", - "size": 16 - } - } - }, - "statistics": { - "type": "object", - "properties": { - "minimum": { - "description": "Minimum value of measurements", - "$ref": "#/definitions/time", - "example": 1 - }, - "maximum": { - "description": "Maximum value of measurements", - "$ref": "#/definitions/time", - "example": 4 - }, - "average": { - "description": "Average value of measurements", - "$ref": "#/definitions/time", - "example": 2 - }, - "count": { - "description": "How many times measurement has been collected", - "$ref": "#/definitions/time", - "example": 5 - } - } - } - }, - "properties": { - "measurement": { - "summary": "Retrieve the performance measurement against given package size. Measurements will be provided in milliseconds", - "readonly": true, - "params": { - "type": "object", - "properties": { - "serialization": { - "description": "Time taken to complete serialization", - "$ref": "#/definitions/statistics" - }, - "deserialization": { - "description": "Time taken to complete deserialization", - "$ref": "#/definitions/statistics" - }, - "execution": { - "description": "Time taken to complete execution", - "$ref": "#/definitions/statistics" - }, - "threadpool": { - "description": "Time taken to complete threadpool wait", - "$ref": "#/definitions/statistics" - }, - "communication": { - "description": "Time taken to complete communication", - "$ref": "#/definitions/statistics" - }, - "total": { - "description": "Time taken to complete whole jsonrpc process", - "$ref": "#/definitions/statistics" - } - }, - "required": [ - "serialization", - "deserialization", - "execution", - "threadpool", - "communication", - "total" - ] - }, - "index": { - "name": "Package size", - "description": "Size of package whose statistics info has to be retrieved", - "example": "1000" - }, - "result": { - "$ref": "#/common/results/void" - } - } - }, - "methods": { - "clear": { - "summary": "Clear all performance data collected", - "result": { - "$ref": "#/common/results/void" - } - }, - "send": { - "summary": "Interface to test send data", - "params": { - "$ref": "#/definitions/buffer" - }, - "result": { - "$ref": "#/definitions/datasize", - "description": "Size of data received by the jsonrpc interface" - } - }, - "receive": { - "summary": "Interface to test receive data", - "params": { - "$ref": "#/definitions/datasize", - "description": "Size of data to be provided by the jsonrpc interface" - }, - "result": { - "$ref": "#/definitions/buffer" - } - }, - "exchange": { - "summary": "Interface to test exchange data", - "params": { - "$ref": "#/definitions/buffer" - }, - "result": { - "$ref": "#/definitions/buffer" - } - } - } -}