diff --git a/code/DDSCodeTester.cpp b/code/DDSCodeTester.cpp index 873a35cf8..b31558f2b 100644 --- a/code/DDSCodeTester.cpp +++ b/code/DDSCodeTester.cpp @@ -647,6 +647,43 @@ void dds_domain_examples() "HISTORY_LATENCY_TOPIC;ACKNACK_COUNT_TOPIC;DISCOVERY_TOPIC;PHYSICAL_DATA_TOPIC"); //!-- } + { + // FASTDDS_MONITOR_SERVICE_PROPERTY + DomainParticipantQos pqos; + + // Enable Fast DDS Monitor Service through properties + pqos.properties().properties().emplace_back("fastdds.enable_monitor_service", + "true"); + + // Enable Fast DDS Monitor Service through statistics properties (other way) + pqos.properties().properties().emplace_back("fastdds.statistics", + "MONITOR_SERVICE_TOPIC"); + + DomainParticipant* participant_with_mon_srv = DomainParticipantFactory::get_instance()->create_participant(0, + pqos); + + //!-- + } + { + // FASTDDS_MONITOR_SERVICE_API + + DomainParticipant* participant = DomainParticipantFactory::get_instance()->create_participant(0, + PARTICIPANT_QOS_DEFAULT); + + // Obtain pointer to child class + eprosima::fastdds::statistics::dds::DomainParticipant* statistics_participant = + eprosima::fastdds::statistics::dds::DomainParticipant::narrow(participant); + + + // Enable Fast DDS Monitor Service through API + statistics_participant->enable_monitor_service(); + + // Disable Fast DDS Monitor Service through API + statistics_participant->disable_monitor_service(); + + + //!-- + } { // FASTDDS_PHYSICAL_PROPERTIES /* Create participant which announces default physical properties */ diff --git a/code/XMLTester.xml b/code/XMLTester.xml index 4aaf3fd6c..79529b1d0 100644 --- a/code/XMLTester.xml +++ b/code/XMLTester.xml @@ -2858,6 +2858,31 @@ <--> +DDS_MONITOR_SERVICE<--> + + + + + + + + fastdds.enable_monitor_service + true + + + + fastdds.statistics + MONITOR_SERVICE_TOPIC + + + + + +<--> + PULL_MODE_DATAWRITER<--> DDS_MONITOR_SERVICE<--> + :end-before: <--> + :lines: 2-3,5-22 + :append: + + .. tab:: Env. Variable Linux + + .. code-block:: bash + + export FASTDDS_STATISTICS="MONITOR_SERVICE_TOPIC" + + .. tab:: Env. Variable Windows + + .. code-block:: bash + + set FASTDDS_STATISTICS=MONITOR_SERVICE_TOPIC + +Endpoints QoS +^^^^^^^^^^^^^ + +For any consumer application of the :ref:`monitor_service`, the following endpoint QoS +of the :ref:`monitor_service_status_topic` DataWriter should be taken into consideration: + ++-------------------------+-------------------------------+------------------------------------+ +| **Endpoint** | **QoS** | **Value** | ++-------------------------+-------------------------------+------------------------------------+ +| MONITOR_STATUS_WRITER | |ReliabilityQosPolicyKind-api|||RELIABLE_RELIABILITY_QOS-api| | +| +-------------------------------+------------------------------------+ +| | |HistoryQosPolicyKind-api| ||KEEP_LAST_HISTORY_QOS-api| 1 | +| +-------------------------------+------------------------------------+ +| | |DurabilityQosPolicyKind-api| ||TRANSIENT_LOCAL_DURABILITY_QOS-api|| ++-------------------------+-------------------------------+------------------------------------+ diff --git a/docs/fastdds/statistics/monitor_service/monitor_service_topics.rst b/docs/fastdds/statistics/monitor_service/monitor_service_topics.rst new file mode 100644 index 000000000..b3b20f907 --- /dev/null +++ b/docs/fastdds/statistics/monitor_service/monitor_service_topics.rst @@ -0,0 +1,155 @@ +.. include:: ../../../03-exports/aliases.include +.. include:: ../../../03-exports/aliases-api.include + +.. _monitor_service_topics: + +Monitor Service Topics +====================== + +The following table depicts the properties of the topics within the :ref:`monitor_service`: + ++---------------------------------------+-------------------------+---------------------------------------+ +|**Topic name** |**Topic Alias** | **TopicDataType** | ++---------------------------------------+-------------------------+---------------------------------------+ +| ``fastrtps_monitor_service_status`` | MONITOR_SERVICE_TOPIC | :ref:`monitor_service_status_data` | ++---------------------------------------+-------------------------+---------------------------------------+ + +.. _monitor_service_status_topic: + +Monitor Service Status Topic +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The ``Monitor Service Status Topic`` carries information about the +:ref:`monitoring information ` of the local entities of a +particular |DomainParticipant|. +The :ref:`monitoring information ` can be divided into different statuses +identified by a ``StatusKind``. +The possible values are described in the following table: + +.. _monitoring_statuses: + ++---------+-----------------------------+-----------------------------------------+ +|**Value**| **Name** | **Description** | ++---------+-----------------------------+-----------------------------------------+ +| 0 | ``ProxyInfo`` | Collection of Parameters describing the | +| | | ``Proxy Data`` of that entity | ++---------+-----------------------------+-----------------------------------------+ +| 1 | ``ConnectionList`` | List of connections that this entity is | +| | | using with its matched remote entities. | ++---------+-----------------------------+-----------------------------------------+ +| 2 | ``IncompatibleQoSInfo`` | Status of the Incompatible QoS | +| | | of that entity. | ++---------+-----------------------------+-----------------------------------------+ +| 3 | ``InconsistentTopicInfo`` | Status of Inconsistent topics that the | +| | | topic of that entity has. | ++---------+-----------------------------+-----------------------------------------+ +| 4 | ``LivelinessLostInfo`` | Tracks the status of the number of times| +| | | a writer lost liveliness. | ++---------+-----------------------------+-----------------------------------------+ +| 5 | ``LivelinessChangedInfo`` | Tracks the status of the number of times| +| | | the liveliness changed in a reader. | ++---------+-----------------------------+-----------------------------------------+ +| 6 | ``DeadlineMissedInfo`` | The Status of the number of deadlines | +| | | missed of a sample for that entity. | ++---------+-----------------------------+-----------------------------------------+ +| 7 | ``SampleLostInfo`` | Tracks the status of the number of times| +| | | this entity lost samples. | ++---------+-----------------------------+-----------------------------------------+ + +.. note:: + + If the service is enabled in a :ref:`RTPS layer ` context, :ref:`not all + the statuses will be published `, + only the ``ProxyInfo`` and ``ConnectionList``. + +The ``Monitor Service Status Topic`` publishes new data when new updates are received from any +of the |DomainParticipant|'s local entities (on-event driven) with a minimum waiting time between +publications. +In addition, it is in charge of notifying about any disposal or liveliness lost. + +.. _monitor_service_status_data: + +Monitor Service Status Data +--------------------------- + +The ``MonitorServiceStatusData`` data structure comprises the following fields: + +* *local_entity:* |Guid_t-api| of the local entity. +* *status_kind:* :ref:`StatusKind ` enumeration identifying the status. +* *value:* The value of the status. + +.. code-block:: bash + + MonitorServiceStatusData + @Key GUID local_entity + @Key StatusKind status_kind + Data value + +.. note:: + + The *local_entity* and *status_kind* are keyed fields, hence making use of instances (see :ref:`dds_layer_topic_instances`). + In this case, the pair <*local_entity, status_kind*> identifies a unique instance. + + +Each of the ``StatusKind`` enumeration values maps to a corresponding ``Data`` value. +The actual field names for the different values are described below: + +* *entity_proxy:* Collection of the serialized Quality of Service Parameters in the form of a ``ParameterList``. + +* *connection_list:* Defines how is this entity communicating with its matched entities. + Each of the elements is of Connection type (depicted below). + +.. code-block:: bash + + Connection + uint32_t mode //INTRAPROCESS, DATASHARING, TRANSPORT + LocatorList announced_locators + LocatorList used_locators + +* *incompatible_qos_status:* Status of the Incompatible QoS of that entity. + + * |DataWriter| Incompatible QoS Offered. + * |DataReader| Incompatible QoS Requested. + +* *inconsistent_topic_status:* Status of Inconsistent topics of the topic of that entity. + Asked to the topic of the requested entity. + +* *liveliness_lost_status:* Tracks the status of the number of times that liveliness was lost by a + |DataWriter|. + +* *liveliness_changed_status:* Tracks the status of the number of times that liveliness was lost + by a |DataReader|. + +* *deadline_status:* The Status of the number of deadlines missed that were registered in that entity. + +* *sample_lost_status:* The number of samples that entity lost. + +The following table depicts the relation between each of the ``StatusKind`` values and the ``Data`` field: + ++---------------------+---------------------------+---------------------------+---------------------------+ +|**StatusKind Value** | **StatusKind Name** | **Data field Name** | **IDL Data field Type** | ++---------------------+---------------------------+---------------------------+---------------------------+ +| 0 | ``ProxyInfo`` | entity_proxy | sequence | +| | | | | ++---------------------+---------------------------+---------------------------+---------------------------+ +| 1 | ``ConnectionList`` | connection_list | sequence | +| | | | | ++---------------------+---------------------------+---------------------------+---------------------------+ +| 2 | ``IncompatibleQoSInfo`` | incompatible_qos_status | IncompatibleQoSStatus | +| | | | | ++---------------------+---------------------------+---------------------------+---------------------------+ +| 3 | ``InconsistentTopicInfo`` | inconsistent_topic_status | InconsistentTopicStatus | +| | | | | ++---------------------+---------------------------+---------------------------+---------------------------+ +| 4 | ``LivelinessLostInfo`` | liveliness_lost_status | LivelinessLostStatus | +| | | | | ++---------------------+---------------------------+---------------------------+---------------------------+ +| 5 | ``LivelinessLostInfo`` | liveliness_changed_status | LivelinessChangedStatus | +| | | | | ++---------------------+---------------------------+---------------------------+---------------------------+ +| 6 | ``DeadlineMissedInfo`` | deadline_missed_status | DeadlineMissedStatus | +| | | | | ++---------------------+---------------------------+---------------------------+---------------------------+ +| 7 | ``SampleLostInfo`` | sample_lost_status | SampleLostStatus | +| | | | | ++---------------------+---------------------------+---------------------------+---------------------------+ diff --git a/docs/fastdds/statistics/statistics.rst b/docs/fastdds/statistics/statistics.rst index e762e1a80..69539d1b6 100644 --- a/docs/fastdds/statistics/statistics.rst +++ b/docs/fastdds/statistics/statistics.rst @@ -13,3 +13,4 @@ Statistics Module :maxdepth: 2 dds_layer/statistics_dds_layer + monitor_service/monitor_service diff --git a/docs/index.rst b/docs/index.rst index 455fbc856..6b819e336 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -45,10 +45,10 @@ /fastdds/persistence/persistence /fastdds/security/security /fastdds/logging/intro - /fastdds/statistics/statistics /fastdds/xml_configuration/xml_configuration /fastdds/env_vars/env_vars /fastdds/property_policies/property_policies + /fastdds/statistics/statistics /fastdds/dynamic_types/dynamic_types /fastdds/use_cases/use_cases /fastdds/ros2/ros2 diff --git a/docs/spelling_wordlist.txt b/docs/spelling_wordlist.txt index 51d23178d..b316cd700 100644 --- a/docs/spelling_wordlist.txt +++ b/docs/spelling_wordlist.txt @@ -156,6 +156,7 @@ mandatorily md metatraffic middleware +misconfigurations modularity msvc multicast @@ -177,6 +178,7 @@ nupkg offsetd oneway OpenSSL +optionality optionparser OSS overcomplicated @@ -239,6 +241,7 @@ submodules subnet superset takeNextData +targetting TCP tcpdump thirdparty