From 6e55d5a4f7475d9e51e47afe1fef26f9e7ed9186 Mon Sep 17 00:00:00 2001 From: VeithMetro Date: Tue, 22 Jul 2025 09:14:55 +0200 Subject: [PATCH] Adjust the plugin after changes to the interface --- PerformanceMonitor/CMakeLists.txt | 3 +- PerformanceMonitor/PerformanceMonitor.cpp | 91 +++--- PerformanceMonitor/PerformanceMonitor.h | 70 +++-- .../PerformanceMonitorJsonRpc.cpp | 94 ------ .../PerformanceMonitorPlugin.json | 2 +- .../doc/PerformanceMonitorPlugin.md | 273 ++++++++++-------- 6 files changed, 232 insertions(+), 301 deletions(-) delete mode 100644 PerformanceMonitor/PerformanceMonitorJsonRpc.cpp diff --git a/PerformanceMonitor/CMakeLists.txt b/PerformanceMonitor/CMakeLists.txt index 001af6a08..edf654d53 100644 --- a/PerformanceMonitor/CMakeLists.txt +++ b/PerformanceMonitor/CMakeLists.txt @@ -37,8 +37,7 @@ find_package(CompileSettingsDebug CONFIG REQUIRED) add_library(${MODULE_NAME} SHARED Module.cpp - PerformanceMonitor.cpp - PerformanceMonitorJsonRpc.cpp) + PerformanceMonitor.cpp) set_target_properties(${MODULE_NAME} PROPERTIES CXX_STANDARD 11 diff --git a/PerformanceMonitor/PerformanceMonitor.cpp b/PerformanceMonitor/PerformanceMonitor.cpp index a56ff1e1c..d8510f379 100644 --- a/PerformanceMonitor/PerformanceMonitor.cpp +++ b/PerformanceMonitor/PerformanceMonitor.cpp @@ -45,11 +45,16 @@ namespace Plugin { ASSERT(service != nullptr); _skipURL = static_cast(service->WebPrefix().length()); + Exchange::JPerformance::Register(*this, this); + Exchange::JPerformanceStatistics::Register(*this, this); + return string(); } /* virtual */ void PerformanceMonitor::Deinitialize(PluginHost::IShell* service VARIABLE_IS_NOT_USED) { + Exchange::JPerformance::Unregister(*this); + Exchange::JPerformanceStatistics::Unregister(*this); } /* virtual */ string PerformanceMonitor::Information() const @@ -57,82 +62,52 @@ namespace Plugin { // No additional info to report. return ((_T("The purpose of this plugin is provide ability to collect performance values of JSONRPC communication"))); } - uint32_t PerformanceMonitor::RetrieveInfo(const uint32_t packageSize, JsonData::PerformanceMonitor::MeasurementData& measurementData) const { - const PluginHost::PerformanceAdministrator::Statistics& statistics(PluginHost::PerformanceAdministrator::Instance().Retrieve(packageSize)); - - Measurement(statistics.Serialization(), measurementData.Serialization); - Measurement(statistics.Deserialization(), measurementData.Deserialization); - Measurement(statistics.Execution(), measurementData.Execution); - Measurement(statistics.ThreadPool(), measurementData.Threadpool); - Measurement(statistics.Communication(), measurementData.Communication); - Measurement(statistics.Total(), measurementData.Total); - return Core::ERROR_NONE; - } - - uint32_t PerformanceMonitor::Send(const JsonData::PerformanceMonitor::BufferInfo& data, Core::JSON::DecUInt32& result) + Core::hresult PerformanceMonitor::Send(const uint16_t /* sendSize */, const uint8_t* /* buffer */) { - uint16_t length = static_cast(((data.Data.Value().length() * 6) + 7) / 8); - uint8_t* buffer = static_cast(ALLOCA(length)); - Core::FromString(data.Data.Value(), buffer, length); - result = length; - - return Core::ERROR_NONE; + return (Core::ERROR_NONE); } - uint32_t PerformanceMonitor::Receive(const Core::JSON::DecUInt32& maxSize, JsonData::PerformanceMonitor::BufferInfo& data) + Core::hresult PerformanceMonitor::Receive(uint16_t& bufferSize, uint8_t buffer[]) const { - string convertedBuffer; - - uint32_t length = maxSize.Value(); - uint8_t* buffer = static_cast(ALLOCA(length)); - - static uint8_t pattern[] = { 0x00, 0x66, 0xBB, 0xEE }; + uint8_t pattern[] = { 0x00, 0x66, 0xBB, 0xEE }; uint8_t patternLength = sizeof(pattern); - uint32_t index = 0; - uint8_t patternIndex = 0; - - while (index < length) { - - buffer[index++] = pattern[patternIndex++]; - patternIndex %= (patternLength - 1); - } + FillBuffer(bufferSize, buffer, patternLength, pattern); - Core::ToString(buffer, length, false, convertedBuffer); - data.Data = convertedBuffer; - data.Length = static_cast(convertedBuffer.length()); - data.Duration = static_cast(convertedBuffer.length()) + 1; //Dummy - - return Core::ERROR_NONE; + return (Core::ERROR_NONE); } - uint32_t PerformanceMonitor::Exchange(const JsonData::PerformanceMonitor::BufferInfo& data, JsonData::PerformanceMonitor::BufferInfo& result) + Core::hresult PerformanceMonitor::Exchange(uint16_t& /* bufferSize */, uint8_t buffer[], const uint16_t maxBufferSize) { - string convertedBuffer; + uint8_t pattern[] = { 0x00, 0x77, 0xCC, 0x88 }; + uint8_t patternLength = sizeof(pattern); - uint16_t length = static_cast(data.Data.Value().length()); - uint8_t* buffer = static_cast(ALLOCA(length)); - Core::FromString(data.Data.Value(), buffer, length); + FillBuffer(maxBufferSize, buffer, patternLength, pattern); - static uint8_t pattern[] = { 0x00, 0x77, 0xCC, 0x88 }; - uint8_t patternLength = sizeof(pattern); - uint16_t index = 0; - uint8_t patternIndex = 0; + return (Core::ERROR_NONE); + } - while (index < data.Length.Value()) { + Core::hresult PerformanceMonitor::Measurement(const uint32_t index, Exchange::IPerformanceStatistics::Measurements& measurement) const + { + const PluginHost::PerformanceAdministrator::Statistics& statistics(PluginHost::PerformanceAdministrator::Instance().Retrieve(index)); - buffer[index++] = pattern[patternIndex++]; + Measurement(statistics.Serialization(), measurement.serialization); + Measurement(statistics.Deserialization(), measurement.deserialization); + Measurement(statistics.Execution(), measurement.execution); + Measurement(statistics.ThreadPool(), measurement.threadPool); + Measurement(statistics.Communication(), measurement.communication); + Measurement(statistics.Total(), measurement.total); - patternIndex %= (patternLength - 1); - } + return (Core::ERROR_NONE); + } - Core::ToString(buffer, length, false, convertedBuffer); - result.Data = convertedBuffer; - result.Length = static_cast(convertedBuffer.length()); - result.Duration = static_cast(convertedBuffer.length()) + 1; //Dummy + Core::hresult PerformanceMonitor::Reset() + { + PluginHost::PerformanceAdministrator::Instance().Clear(); - return Core::ERROR_NONE; + return (Core::ERROR_NONE); } + } // namespace Plugin } // namespace Thunder diff --git a/PerformanceMonitor/PerformanceMonitor.h b/PerformanceMonitor/PerformanceMonitor.h index 4974682a4..d95b87106 100644 --- a/PerformanceMonitor/PerformanceMonitor.h +++ b/PerformanceMonitor/PerformanceMonitor.h @@ -20,30 +20,31 @@ #pragma once #include "Module.h" - -#include +#include +#include +#include namespace Thunder { namespace Plugin { - class PerformanceMonitor : public PluginHost::IPlugin, public PluginHost::JSONRPC { + class PerformanceMonitor : public Exchange::IPerformance + , public Exchange::IPerformanceStatistics + , public PluginHost::IPlugin + , public PluginHost::JSONRPC { public: PerformanceMonitor(const PerformanceMonitor&) = delete; PerformanceMonitor& operator=(const PerformanceMonitor&) = delete; public: PerformanceMonitor() - : _skipURL(0) - { - RegisterAll(); + : _skipURL(0) { } - ~PerformanceMonitor() override - { - UnregisterAll(); - } + ~PerformanceMonitor() override = default; BEGIN_INTERFACE_MAP(PerformanceMonitor) + INTERFACE_ENTRY(Exchange::IPerformance) + INTERFACE_ENTRY(Exchange::IPerformanceStatistics) INTERFACE_ENTRY(PluginHost::IPlugin) INTERFACE_ENTRY(PluginHost::IDispatcher) END_INTERFACE_MAP @@ -55,25 +56,36 @@ namespace Plugin { string Information() const override; private: - void RegisterAll(); - void UnregisterAll(); - uint32_t endpoint_clear(); - uint32_t endpoint_send(const JsonData::PerformanceMonitor::BufferInfo& params, Core::JSON::DecUInt32& response); - uint32_t endpoint_receive(const Core::JSON::DecUInt32& params, JsonData::PerformanceMonitor::BufferInfo& response); - uint32_t endpoint_exchange(const JsonData::PerformanceMonitor::BufferInfo& params, JsonData::PerformanceMonitor::BufferInfo& response); - uint32_t get_measurement(const string& index, JsonData::PerformanceMonitor::MeasurementData& response) const; - - uint32_t RetrieveInfo(const uint32_t packageSize, JsonData::PerformanceMonitor::MeasurementData& measurementData) const; - uint32_t Send(const JsonData::PerformanceMonitor::BufferInfo& data, Core::JSON::DecUInt32& result); - uint32_t Receive(const Core::JSON::DecUInt32& maxSize, JsonData::PerformanceMonitor::BufferInfo& data); - uint32_t Exchange(const JsonData::PerformanceMonitor::BufferInfo& data, JsonData::PerformanceMonitor::BufferInfo& result); - - inline void Measurement(const PluginHost::PerformanceAdministrator::Statistics::Tuple& statistics, JsonData::PerformanceMonitor::MeasurementData::StatisticsData& statisticsData) const { - - statisticsData.Minimum = statistics.Minimum(); - statisticsData.Maximum = statistics.Maximum(); - statisticsData.Average = statistics.Average(); - statisticsData.Count = statistics.Count(); + // IPerformance methods - a majority of the code for performance measurement is provided by the generators + // ------------------------------------------------------------------------------------------------------- + Core::hresult Send(const uint16_t sendSize, const uint8_t buffer[]) override; + Core::hresult Receive(uint16_t& bufferSize, uint8_t buffer[]) const override; + Core::hresult Exchange(uint16_t& bufferSize, uint8_t buffer[], const uint16_t maxBufferSize) override; + + // IPerformanceStatistics methods + // ------------------------------------------------------------------------------------------------------- + Core::hresult Measurement(const uint32_t index, Exchange::IPerformanceStatistics::Measurements& measurement) const override; + Core::hresult Reset() override; + + inline void Measurement(const PluginHost::PerformanceAdministrator::Statistics::Tuple& statistics, Exchange::IPerformanceStatistics::Statistics& statisticsData) const + { + statisticsData.minimum = statistics.Minimum(); + statisticsData.maximum = statistics.Maximum(); + statisticsData.average = statistics.Average(); + statisticsData.count = statistics.Count(); + } + + inline void FillBuffer(const uint16_t& bufferSize, uint8_t buffer[], const uint8_t patternLength, const uint8_t pattern[]) const + { + uint32_t index = 0; + uint8_t patternIndex = 0; + + while (index < bufferSize) { + + buffer[index++] = pattern[patternIndex++]; + + patternIndex %= (patternLength - 1); + } } private: diff --git a/PerformanceMonitor/PerformanceMonitorJsonRpc.cpp b/PerformanceMonitor/PerformanceMonitorJsonRpc.cpp deleted file mode 100644 index 3d5bfdcbd..000000000 --- a/PerformanceMonitor/PerformanceMonitorJsonRpc.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2020 Metrological - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "Module.h" -#include "PerformanceMonitor.h" -#include - -namespace Thunder { -namespace Plugin { - - using namespace JsonData::PerformanceMonitor; - - // Registration - // - - void PerformanceMonitor::RegisterAll() - { - Register(_T("clear"), &PerformanceMonitor::endpoint_clear, this); - Register(_T("send"), &PerformanceMonitor::endpoint_send, this); - Register(_T("receive"), &PerformanceMonitor::endpoint_receive, this); - Register(_T("exchange"), &PerformanceMonitor::endpoint_exchange, this); - Property(_T("measurement"), &PerformanceMonitor::get_measurement, nullptr, this); - } - - void PerformanceMonitor::UnregisterAll() - { - Unregister(_T("send")); - Unregister(_T("receive")); - Unregister(_T("exchange")); - Unregister(_T("clear")); - Unregister(_T("measurement")); - } - - // API implementation - // - - // Method: clear - Clear all performance data collected - // Return codes: - // - ERROR_NONE: Success - uint32_t PerformanceMonitor::endpoint_clear() - { - PluginHost::PerformanceAdministrator::Instance().Clear(); - return Core::ERROR_NONE; - } - - // Method: send - Interface to test sending data - // Return codes: - // - ERROR_NONE: Success - uint32_t PerformanceMonitor::endpoint_send(const BufferInfo& params, Core::JSON::DecUInt32& response) - { - return Send(params, response); - } - - // Return codes: - // - ERROR_NONE: Success - uint32_t PerformanceMonitor::endpoint_receive(const Core::JSON::DecUInt32& params, BufferInfo& response) - { - return Receive(params, response); - } - - // Return codes: - // - ERROR_NONE: Success - uint32_t PerformanceMonitor::endpoint_exchange(const BufferInfo& params, BufferInfo& response) - { - return Exchange(params, response); - } - - // Property: measurement - Retrieve the performance measurement against given package size - // Return codes: - // - ERROR_NONE: Success - uint32_t PerformanceMonitor::get_measurement(const string& index, MeasurementData& response) const - { - const uint32_t& packageSize = atoi(index.c_str()); - return RetrieveInfo(packageSize, response); - } - -} // namespace Plugin -} - diff --git a/PerformanceMonitor/PerformanceMonitorPlugin.json b/PerformanceMonitor/PerformanceMonitorPlugin.json index cea50bbf7..415e2c488 100644 --- a/PerformanceMonitor/PerformanceMonitorPlugin.json +++ b/PerformanceMonitor/PerformanceMonitorPlugin.json @@ -9,6 +9,6 @@ "version": "1.0" }, "interface": { - "$ref": "{interfacedir}/PerformanceMonitor.json#" + "$ref": "{cppinterfacedir}/IPerformance.h" } } diff --git a/PerformanceMonitor/doc/PerformanceMonitorPlugin.md b/PerformanceMonitor/doc/PerformanceMonitorPlugin.md index b7725d83d..abcf87bd8 100644 --- a/PerformanceMonitor/doc/PerformanceMonitorPlugin.md +++ b/PerformanceMonitor/doc/PerformanceMonitorPlugin.md @@ -1,5 +1,5 @@ - + # Performance Monitor Plugin **Version: 1.0** @@ -10,27 +10,27 @@ PerformanceMonitor plugin for Thunder framework. ### Table of Contents -- [Introduction](#head.Introduction) -- [Description](#head.Description) -- [Configuration](#head.Configuration) -- [Interfaces](#head.Interfaces) -- [Methods](#head.Methods) -- [Properties](#head.Properties) +- [Introduction](#head_Introduction) +- [Description](#head_Description) +- [Configuration](#head_Configuration) +- [Interfaces](#head_Interfaces) +- [Methods](#head_Methods) +- [Properties](#head_Properties) - + # Introduction - + ## Scope This document describes purpose and functionality of the PerformanceMonitor plugin. It includes detailed specification about its configuration, methods and properties provided. - + ## Case Sensitivity All identifiers of the interfaces described in this document are case-sensitive. Thus, unless stated otherwise, all keywords, entities, properties, relations and actions should be treated as such. - + ## Acronyms, Abbreviations and Terms The table below provides and overview of acronyms used in this document and their definitions. @@ -48,7 +48,7 @@ The table below provides and overview of terms and abbreviations used in this do | :-------- | :-------- | | callsign | The name given to an instance of a plugin. One plugin can be instantiated multiple times, but each instance the instance name, callsign, must be unique. | - + ## References | Ref ID | Description | @@ -58,14 +58,14 @@ The table below provides and overview of terms and abbreviations used in this do | [JSON](http://www.json.org/) | JSON specification | | [Thunder](https://github.com/WebPlatformForEmbedded/Thunder/blob/master/doc/WPE%20-%20API%20-%20Thunder.docx) | Thunder API Reference | - + # Description Retrieve the performance measurement against given package size. The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. - + # Configuration The table below lists configuration options of the plugin. @@ -77,41 +77,54 @@ The table below lists configuration options of the plugin. | locator | string | mandatory | Library name: *libThunderPerformanceMonitor.so* | | startmode | string | mandatory | Determines in which state the plugin should be moved to at startup of the framework | - + # Interfaces This plugin implements the following interfaces: -- [PerformanceMonitor.json](https://github.com/rdkcentral/ThunderInterfaces/blob/master/jsonrpc/PerformanceMonitor.json) (version 1.0.0) (uncompliant-collapsed format) +- IPerformance ([IPerformance.h](https://github.com/rdkcentral/ThunderInterfaces/blob/master/interfaces/IPerformance.h)) (version 1.0.0) (compliant format) +> This interface uses legacy ```lowercase``` naming convention. With the next major release the naming convention will change to ```camelCase```. - +- IPerformanceStatistics ([IPerformance.h](https://github.com/rdkcentral/ThunderInterfaces/blob/master/interfaces/IPerformance.h)) (version 1.0.0) (compliant format) +> This interface uses legacy ```lowercase``` naming convention. With the next major release the naming convention will change to ```camelCase```. + + # Methods The following methods are provided by the PerformanceMonitor plugin: -PerformanceMonitor interface methods: +Performance interface methods: + +| Method | Description | +| :-------- | :-------- | +| [send](#method_send) | Test the process of sending the data | +| [receive](#method_receive) | Test the process of receiving the data | +| [exchange](#method_exchange) | Test the process of both sending and receiving the data | + +PerformanceStatistics interface methods: | Method | Description | | :-------- | :-------- | -| [clear](#method.clear) | Clear all performance data collected | -| [send](#method.send) | Interface to test send data | -| [receive](#method.receive) | Interface to test receive data | -| [exchange](#method.exchange) | Interface to test exchange data | +| [reset](#method_reset) / [clear](#method_reset) | Clear all performance data collected so far | - -## *clear [method](#head.Methods)* + +## *send [method](#head_Methods)* -Clear all performance data collected. +Test the process of sending the data. ### Parameters -This method takes no parameters. +| Name | Type | M/O | Description | +| :-------- | :-------- | :-------- | :-------- | +| params | object | mandatory | *...* | +| params.sendsize | integer | mandatory | Length of the sent data | +| params.buffer | string (base64) | mandatory | Any data to be sent | ### Result | Name | Type | M/O | Description | | :-------- | :-------- | :-------- | :-------- | -| result | null | mandatory | Always null (default: *None*) | +| result | null | mandatory | Always null | ### Example @@ -121,7 +134,11 @@ This method takes no parameters. { "jsonrpc": "2.0", "id": 42, - "method": "PerformanceMonitor.1.clear" + "method": "PerformanceMonitor.1.send", + "params": { + "sendsize": 15, + "buffer": "HelloWorld" + } } ``` @@ -135,25 +152,25 @@ This method takes no parameters. } ``` - -## *send [method](#head.Methods)* + +## *receive [method](#head_Methods)* -Interface to test send data. +Test the process of receiving the data. ### Parameters | Name | Type | M/O | Description | | :-------- | :-------- | :-------- | :-------- | | params | object | mandatory | *...* | -| params?.data | string | optional | Any string data upto the size specified in the length | -| params?.length | integer | optional | Size of the data | -| params?.duration | integer | optional | Duration of the measurements | +| params.buffersize | integer | mandatory | Size of data to be provided | ### Result | Name | Type | M/O | Description | | :-------- | :-------- | :-------- | :-------- | -| result | integer | mandatory | Size of data received by the jsonrpc interface | +| result | object | mandatory | *...* | +| result.buffersize | integer | mandatory | Size of data to be provided | +| result.buffer | string (base64) | mandatory | Data with a specified length | ### Example @@ -163,11 +180,9 @@ Interface to test send data. { "jsonrpc": "2.0", "id": 42, - "method": "PerformanceMonitor.1.send", + "method": "PerformanceMonitor.1.receive", "params": { - "data": "abababababab", - "length": 0, - "duration": 0 + "buffersize": 10 } } ``` @@ -178,29 +193,34 @@ Interface to test send data. { "jsonrpc": "2.0", "id": 42, - "result": 0 + "result": { + "buffersize": 10, + "buffer": "fhrjtus4p1" + } } ``` - -## *receive [method](#head.Methods)* + +## *exchange [method](#head_Methods)* -Interface to test receive data. +Test the process of both sending and receiving the data. ### Parameters | Name | Type | M/O | Description | | :-------- | :-------- | :-------- | :-------- | -| params | integer | mandatory | Size of data to be provided by the jsonrpc interface | +| params | object | mandatory | *...* | +| params.buffersize | integer | mandatory | Length of the data to be both sent as well as received | +| params.buffer | string (base64) | mandatory | Data to be sent and then also received | +| params.maxbuffersize | integer | mandatory | Maximum size of the buffer that can be received | ### Result | Name | Type | M/O | Description | | :-------- | :-------- | :-------- | :-------- | | result | object | mandatory | *...* | -| result?.data | string | optional | Any string data upto the size specified in the length | -| result?.length | integer | optional | Size of the data | -| result?.duration | integer | optional | Duration of the measurements | +| result.buffersize | integer | mandatory | Length of the data to be both sent as well as received | +| result.buffer | string (base64) | mandatory | Data to be sent and then also received | ### Example @@ -210,8 +230,12 @@ Interface to test receive data. { "jsonrpc": "2.0", "id": 42, - "method": "PerformanceMonitor.1.receive", - "params": 0 + "method": "PerformanceMonitor.1.exchange", + "params": { + "buffersize": 20, + "buffer": "kjrpq018rt", + "maxbuffersize": 100 + } } ``` @@ -222,35 +246,28 @@ Interface to test receive data. "jsonrpc": "2.0", "id": 42, "result": { - "data": "abababababab", - "length": 0, - "duration": 0 + "buffersize": 20, + "buffer": "kjrpq018rt" } } ``` - -## *exchange [method](#head.Methods)* + +## *reset [method](#head_Methods)* + +Clear all performance data collected so far. -Interface to test exchange data. +> ``clear`` is an alternative name for this method. This name is **deprecated** and may be removed in the future. It is not recommended for use in new implementations. ### Parameters -| Name | Type | M/O | Description | -| :-------- | :-------- | :-------- | :-------- | -| params | object | mandatory | *...* | -| params?.data | string | optional | Any string data upto the size specified in the length | -| params?.length | integer | optional | Size of the data | -| params?.duration | integer | optional | Duration of the measurements | +This method takes no parameters. ### Result | Name | Type | M/O | Description | | :-------- | :-------- | :-------- | :-------- | -| result | object | mandatory | *...* | -| result?.data | string | optional | Any string data upto the size specified in the length | -| result?.length | integer | optional | Size of the data | -| result?.duration | integer | optional | Duration of the measurements | +| result | null | mandatory | Always null | ### Example @@ -260,12 +277,7 @@ Interface to test exchange data. { "jsonrpc": "2.0", "id": 42, - "method": "PerformanceMonitor.1.exchange", - "params": { - "data": "abababababab", - "length": 0, - "duration": 0 - } + "method": "PerformanceMonitor.1.reset" } ``` @@ -275,81 +287,71 @@ Interface to test exchange data. { "jsonrpc": "2.0", "id": 42, - "result": { - "data": "abababababab", - "length": 0, - "duration": 0 - } + "result": null } ``` - + # Properties The following properties are provided by the PerformanceMonitor plugin: -PerformanceMonitor interface properties: +PerformanceStatistics interface properties: | Property | R/W | Description | | :-------- | :-------- | :-------- | -| [measurement](#property.measurement) | read-only | Retrieve the performance measurement against given package size | +| [measurement](#property_measurement) | read-only | Retrieve the performance measurement against a given package size | - -## *measurement [property](#head.Properties)* + +## *measurement [property](#head_Properties)* -Provides access to the retrieve the performance measurement against given package size. Measurements will be provided in milliseconds. +Provides access to the retrieve the performance measurement against a given package size. Measurements will be provided in milliseconds. > This property is **read-only**. -> The *package size* parameter shall be passed as the index to the property, e.g. ``PerformanceMonitor.1.measurement@``. +> The *index* parameter shall be passed as the index to the property, i.e. ``measurement@``. ### Index | Name | Type | M/O | Description | | :-------- | :-------- | :-------- | :-------- | -| package-size | string | mandatory | Size of package whose statistics info has to be retrieved | +| index | integer | mandatory | Size of package which statistics info is about to be retrieved | ### Value | Name | Type | M/O | Description | | :-------- | :-------- | :-------- | :-------- | -| (property) | object | mandatory | Retrieve the performance measurement against given package size. Measurements will be provided in milliseconds | +| (property) | object | mandatory | Various performance measurements against a given package size | | (property).serialization | object | mandatory | Time taken to complete serialization | -| (property).serialization?.minimum | integer | optional | Minimum value of measurements | -| (property).serialization?.maximum | integer | optional | Maximum value of measurements | -| (property).serialization?.average | integer | optional | Average value of measurements | -| (property).serialization?.count | integer | optional | How many times measurement has been collected | +| (property).serialization.minimum | integer | mandatory | Minimum value of measurements | +| (property).serialization.maximum | integer | mandatory | Maximum value of measurements | +| (property).serialization.average | integer | mandatory | Average value of measurements | +| (property).serialization.count | integer | mandatory | How many times measurement has been collected | | (property).deserialization | object | mandatory | Time taken to complete deserialization | -| (property).deserialization?.minimum | integer | optional | Minimum value of measurements | -| (property).deserialization?.maximum | integer | optional | Maximum value of measurements | -| (property).deserialization?.average | integer | optional | Average value of measurements | -| (property).deserialization?.count | integer | optional | How many times measurement has been collected | +| (property).deserialization.minimum | integer | mandatory | Minimum value of measurements | +| (property).deserialization.maximum | integer | mandatory | Maximum value of measurements | +| (property).deserialization.average | integer | mandatory | Average value of measurements | +| (property).deserialization.count | integer | mandatory | How many times measurement has been collected | | (property).execution | object | mandatory | Time taken to complete execution | -| (property).execution?.minimum | integer | optional | Minimum value of measurements | -| (property).execution?.maximum | integer | optional | Maximum value of measurements | -| (property).execution?.average | integer | optional | Average value of measurements | -| (property).execution?.count | integer | optional | How many times measurement has been collected | +| (property).execution.minimum | integer | mandatory | Minimum value of measurements | +| (property).execution.maximum | integer | mandatory | Maximum value of measurements | +| (property).execution.average | integer | mandatory | Average value of measurements | +| (property).execution.count | integer | mandatory | How many times measurement has been collected | | (property).threadpool | object | mandatory | Time taken to complete threadpool wait | -| (property).threadpool?.minimum | integer | optional | Minimum value of measurements | -| (property).threadpool?.maximum | integer | optional | Maximum value of measurements | -| (property).threadpool?.average | integer | optional | Average value of measurements | -| (property).threadpool?.count | integer | optional | How many times measurement has been collected | +| (property).threadpool.minimum | integer | mandatory | Minimum value of measurements | +| (property).threadpool.maximum | integer | mandatory | Maximum value of measurements | +| (property).threadpool.average | integer | mandatory | Average value of measurements | +| (property).threadpool.count | integer | mandatory | How many times measurement has been collected | | (property).communication | object | mandatory | Time taken to complete communication | -| (property).communication?.minimum | integer | optional | Minimum value of measurements | -| (property).communication?.maximum | integer | optional | Maximum value of measurements | -| (property).communication?.average | integer | optional | Average value of measurements | -| (property).communication?.count | integer | optional | How many times measurement has been collected | -| (property).total | object | mandatory | Time taken to complete whole jsonrpc process | -| (property).total?.minimum | integer | optional | Minimum value of measurements | -| (property).total?.maximum | integer | optional | Maximum value of measurements | -| (property).total?.average | integer | optional | Average value of measurements | -| (property).total?.count | integer | optional | How many times measurement has been collected | - -### Result - -| Name | Type | M/O | Description | -| :-------- | :-------- | :-------- | :-------- | -| result | null | mandatory | Always null (default: *None*) | +| (property).communication.minimum | integer | mandatory | Minimum value of measurements | +| (property).communication.maximum | integer | mandatory | Maximum value of measurements | +| (property).communication.average | integer | mandatory | Average value of measurements | +| (property).communication.count | integer | mandatory | How many times measurement has been collected | +| (property).total | object | mandatory | Time taken to complete whole JSON-RPC process | +| (property).total.minimum | integer | mandatory | Minimum value of measurements | +| (property).total.maximum | integer | mandatory | Maximum value of measurements | +| (property).total.average | integer | mandatory | Average value of measurements | +| (property).total.count | integer | mandatory | How many times measurement has been collected | ### Example @@ -369,7 +371,44 @@ Provides access to the retrieve the performance measurement against given packag { "jsonrpc": "2.0", "id": 42, - "result": null + "result": { + "serialization": { + "minimum": 1, + "maximum": 4, + "average": 2, + "count": 5 + }, + "deserialization": { + "minimum": 1, + "maximum": 4, + "average": 2, + "count": 5 + }, + "execution": { + "minimum": 1, + "maximum": 4, + "average": 2, + "count": 5 + }, + "threadpool": { + "minimum": 1, + "maximum": 4, + "average": 2, + "count": 5 + }, + "communication": { + "minimum": 1, + "maximum": 4, + "average": 2, + "count": 5 + }, + "total": { + "minimum": 1, + "maximum": 4, + "average": 2, + "count": 5 + } + } } ```