Skip to content

Commit

Permalink
Apply suggestions
Browse files Browse the repository at this point in the history
Signed-off-by: Jesus Perez <[email protected]>
  • Loading branch information
jepemi committed Nov 2, 2023
1 parent f57ca0a commit 3e1525c
Show file tree
Hide file tree
Showing 14 changed files with 221 additions and 206 deletions.
2 changes: 1 addition & 1 deletion docs/code/dump_example.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"name": "participant_0",
"guid": "01.0f.00.00.00.00.00.00.00.00.00.00|00.00.00.00",
"qos": {"qos": "empty"},
"app_id": "UNKNOWN",
"app_id": "UNKNOWN_APP",
"app_metadata": "",

"process": "3",
Expand Down
2 changes: 1 addition & 1 deletion docs/code/participant_info_example.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"user_data": "656e636c6176653d2f3b00",
"vendor_id": "010f"
},
"app_id": "UNKNOWN",
"app_id": "UNKNOWN_APP",
"app_metadata": "",
"locators":
[
Expand Down
9 changes: 4 additions & 5 deletions docs/rst/listeners/domain_listener.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,13 @@ DomainListener defines the following callbacks:
A new data writer has been discovered in the monitored domain,
or an already known data writer has been updated with a new QoS value,
or an already known data writer has been removed from the network.
The arguments in the callback specifies the ID of the data writer and the domain
The arguments in the callback specify the ID of the data writer and the domain
to which it belongs.

* |DomainListener::on_domain_view_graph_update-api|:
A domain view graph has been updated.
The arguments in the callback specifies the ID of the domain whose graph has been updated.
The arguments in the callback specify the ID of the domain whose graph has been updated.

* |DomainListener::on_status_reported-api|:
New status data has been received by the backend.
The arguments in the callback specifies the status kind of the received data
and the entity to which this data refers.
New status data has been received from the backend.
The arguments in the callback specify the status kind of the received data and the entity to which this data refers.
2 changes: 1 addition & 1 deletion docs/rst/notes/forthcoming_version.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ Next release will include the following **API extensions**:
* Added `status` attribute for entities.
* Added database `domain_view_graph` map.
* Added monitor service topic status data storing and processing.
* Get physical information from discovery packets.
* Retrieve physical information from discovery packets.
7 changes: 6 additions & 1 deletion docs/rst/statistics_backend/get_domain_view_graph.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

.. _statistics_backend_get_domain_view_graph:

Get entities' domain view graph
Get entities domain view graph
-------------------------------

*Fast DDS Statistics Backend* allows to retrieve the entire graph of active entities for which the singleton holds
Expand All @@ -19,6 +19,11 @@ For more information about the different |EntityKind-api| please refer to :ref:`

*Fast DDS Statistics Backend* entity relations and their division into physical and domain related.

.. _statistics_backend_get_domain_view_graph_example:

Example
^^^^^^^

The |DomainListener::on_domain_view_graph_update-api| |DomainListener-api| callback notifies when a domain has updated
its graph. Alternatively, the graph can be regenerated manually by calling |regenerate_domain_graph-api|:

Expand Down
2 changes: 1 addition & 1 deletion docs/rst/statistics_backend/get_status_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Only |PARTICIPANT-api|, |DATAWRITER-api| and |DATAREADER-api| have associated st
describes which |StatusKind-api| each of these :ref:`entities<types_entity_kind>` has:

+-------------------------------+-----------------+----------------+----------------+
| Signature ||PARTICIPANT-api|||DATAWRITER-api|||DATAREADER-api||
||StatusKind-api| ||PARTICIPANT-api|||DATAWRITER-api|||DATAREADER-api||
+===============================+=================+================+================+
| |PROXY-api| | Yes | Yes | Yes |
+-------------------------------+-----------------+----------------+----------------+
Expand Down
72 changes: 40 additions & 32 deletions docs/rst/types/status_kind.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,36 @@
StatusData
==========

The *eProsima Fast DDS Statistics Backend* records entities' status data of different nature, as provided by the
The *eProsima Fast DDS Statistics Backend* records entities status data of different nature, as provided by the
Monitor Service from *eProsima Fast DDS Statistics Module*, e.g., incompatible QoS or the number of lost samples. We
refer to the nature of these status data values as their |StatusKind-api|.

- |PROXY-api|: Collection of Parameters describing the Proxy Data of that entity.
- |PROXY-api|: Collection of parameters describing the proxy data of that entity.

- |CONNECTION_LIST-api|: List of connections that this entity is using. Each of the elements is a Connection in which
the possible values for the ConnectionMode are: intraprocess, data sharing, transport. In addition, information
comprising the announced locators and locator in use with each one of the matched entities is also included.
- |CONNECTION_LIST-api|: List of connections used by this entity. Each of the elements is a connection where
the possible values for the connection mode are:

- Intraprocess
- Data sharing
- Transport

In addition, information comprising the announced locators and locator in use with each one of the matched entities
is also included.

- |INCOMPATIBLE_QOS-api|: Status of the incompatible QoS of that entity.

- |INCOMPATIBLE_QOS-api|: Status of the Incompatible QoS of that entity.
- |DATAWRITER-api| Incompatible QoS Offered.
- |DATAREADER-api| Incompatible QoS Requested.

- |INCONSISTENT_TOPIC-api|: Status of Inconsistent topics of the topic of that entity. Asked to the topic of the
- |INCONSISTENT_TOPIC-api|: Status of inconsistent topics of the topic of that entity. Asked to the topic of the
requested entity.

- |LIVELINESS_LOST-api|: Tracks the status of the number of times that liveliness was lost by a |DATAWRITER-api|.

- |LIVELINESS_CHANGED-api|: Tracks the status of the number of times that liveliness status changed in a
|DATAREADER-api|.

- |DEADLINE_MISSED-api|: The Status of the number of deadlines missed that were registered in that entity.
- |DEADLINE_MISSED-api|: The status of the number of missed deadlines registered in that entity.

- |SAMPLE_LOST-api|: Tracks the number of times that this entity lost samples.

Expand All @@ -38,7 +45,7 @@ Only |PARTICIPANT-api|, |DATAWRITER-api| and |DATAREADER-api| have associated st
describes which |StatusKind-api| each of these :ref:`entities<types_entity_kind>` has:

+-------------------------------+-----------------+----------------+----------------+
| Signature ||PARTICIPANT-api|||DATAWRITER-api|||DATAREADER-api||
| |StatusKind-api| ||PARTICIPANT-api|||DATAWRITER-api|||DATAREADER-api||
+===============================+=================+================+================+
| |PROXY-api| | Yes | Yes | Yes |
+-------------------------------+-----------------+----------------+----------------+
Expand All @@ -58,29 +65,30 @@ describes which |StatusKind-api| each of these :ref:`entities<types_entity_kind>
+-------------------------------+-----------------+----------------+----------------+

Each |StatusKind-api| has an associated |StatusLevel-api|. |OK-api| status is obtained when the monitor service message
reports no issue.
Entity's associated |StatusLevel-api| is obtained from all status data. The following table describes which status
levels are associated with each |StatusKind-api|, and to which |StatusLevel-api| they can take an entity:

+-------------------------------+------------------------+-------------------------+
| Signature |Associated status levels|Entity status transitions|
+===============================+========================+=========================+
| |PROXY-api| | |OK-api| | |OK-api| |
+-------------------------------+------------------------+-------------------------+
| |CONNECTION_LIST-api| | |OK-api| | |OK-api| |
+-------------------------------+------------------------+-------------------------+
| |INCOMPATIBLE_QOS-api| | |OK-api|/|ERROR-api| | |OK-api|/|ERROR-api| |
+-------------------------------+------------------------+-------------------------+
| |INCONSISTENT_TOPIC-api| | \- | \- |
+-------------------------------+------------------------+-------------------------+
| |LIVELINESS_LOST-api| | |OK-api|/|WARNING-api| | |OK-api|/|WARNING-api| |
+-------------------------------+------------------------+-------------------------+
| |LIVELINESS_CHANGED-api| | |OK-api| | |OK-api| |
+-------------------------------+------------------------+-------------------------+
| |DEADLINE_MISSED-api| | |OK-api|/|ERROR-api| | |OK-api|/|WARNING-api| |
+-------------------------------+------------------------+-------------------------+
| |SAMPLE_LOST-api| | |OK-api|/|ERROR-api| | |OK-api|/|WARNING-api| |
+-------------------------------+------------------------+-------------------------+
reports no problem.
Entity's associated |StatusLevel-api| is obtained from all status data. The following table describes which
|StatusLevel-api|'s are associated with each |StatusKind-api|, and which |StatusLevel-api|'s are associated with each
DDS Entity in relation to the |StatusKind-api|:

+-------------------------------+-----------------------+------------------------------+
| |StatusKind-api| ||StatusLevel-api|'s |DDS Entity |StatusLevel-api|'s|
+===============================+=======================+==============================+
| |PROXY-api| | |OK-api| | |OK-api| |
+-------------------------------+-----------------------+------------------------------+
| |CONNECTION_LIST-api| | |OK-api| | |OK-api| |
+-------------------------------+-----------------------+------------------------------+
| |INCOMPATIBLE_QOS-api| | |OK-api|/|ERROR-api| | |OK-api|/|ERROR-api| |
+-------------------------------+-----------------------+------------------------------+
| |INCONSISTENT_TOPIC-api| | \- | \- |
+-------------------------------+-----------------------+------------------------------+
| |LIVELINESS_LOST-api| | |OK-api|/|WARNING-api|| |OK-api|/|WARNING-api| |
+-------------------------------+-----------------------+------------------------------+
| |LIVELINESS_CHANGED-api| | |OK-api| | |OK-api| |
+-------------------------------+-----------------------+------------------------------+
| |DEADLINE_MISSED-api| | |OK-api|/|ERROR-api| | |OK-api|/|WARNING-api| |
+-------------------------------+-----------------------+------------------------------+
| |SAMPLE_LOST-api| | |OK-api|/|ERROR-api| | |OK-api|/|WARNING-api| |
+-------------------------------+-----------------------+------------------------------+

.. note::

Expand Down
2 changes: 1 addition & 1 deletion docs/rst/types/status_level.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
StatusLevel
===========

The *eProsima Fast DDS Statistics Backend* keeps track of some of its database members status.
The *eProsima Fast DDS Statistics Backend* keeps track of the status of some of its database members.
The following list shows the possible status values along with their corresponding descriptions.

- |OK-api|: There are no issues to report.
Expand Down
10 changes: 5 additions & 5 deletions src/cpp/database/database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ void Database::process_physical_entities(
host = std::const_pointer_cast<Host>(const_host);
}

physical_entities_ids["host"] = host->id;
physical_entities_ids[HOST_ENTITY_TAG] = host->id;

// Get user entity
auto users = get_entities_by_name_nts(EntityKind::USER, user_name);
Expand All @@ -187,7 +187,7 @@ void Database::process_physical_entities(
user->id = entity_id;
}

physical_entities_ids["user"] = user->id;
physical_entities_ids[USER_ENTITY_TAG] = user->id;

auto processes = get_entities_by_name_nts(EntityKind::PROCESS, process_name);
for (const auto& it : processes)
Expand All @@ -211,7 +211,7 @@ void Database::process_physical_entities(
should_link_process_participant = true;
}

physical_entities_ids["process"] = process->id;
physical_entities_ids[PROCESS_ENTITY_TAG] = process->id;

if (should_link_process_participant && participant_id != EntityId::invalid())
{
Expand Down Expand Up @@ -3342,7 +3342,7 @@ bool Database::regenerate_domain_graph_nts(
Graph* domain_graph = &domain_view_graph[domain_entity_id];

std::shared_ptr<const Entity> domain_entity = get_entity_nts(domain_entity_id);
(*domain_graph)["kind"] = DOMAIN_ENTITY_TAG;
(*domain_graph)[KIND_TAG] = DOMAIN_ENTITY_TAG;
(*domain_graph)[DOMAIN_ENTITY_TAG] = domain_entity->name;
(*domain_graph)[TOPIC_CONTAINER_TAG] = nlohmann::json::object();
(*domain_graph)[HOST_CONTAINER_TAG] = nlohmann::json::object();
Expand Down Expand Up @@ -3605,7 +3605,7 @@ Graph Database::get_entity_subgraph_nts(
{
std::shared_ptr<const DDSEndpoint> endpoint =
std::dynamic_pointer_cast<const DDSEndpoint>(entity);
entity_graph["topic"] = std::to_string(endpoint->topic->id.value());
entity_graph[TOPIC_ENTITY_TAG] = std::to_string(endpoint->topic->id.value());
break;
}
default:
Expand Down
10 changes: 5 additions & 5 deletions src/cpp/database/database_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ EntityId DatabaseEntityQueue::process_participant(
EntityId participant_id = EntityId::invalid();

std::map<std::string, EntityId> physical_entities_ids;
physical_entities_ids["host"] = EntityId::invalid();
physical_entities_ids["user"] = EntityId::invalid();
physical_entities_ids["process"] = EntityId::invalid();
physical_entities_ids[HOST_ENTITY_TAG] = EntityId::invalid();
physical_entities_ids[USER_ENTITY_TAG] = EntityId::invalid();
physical_entities_ids[PROCESS_ENTITY_TAG] = EntityId::invalid();

bool graph_updated = false;
bool should_link_process_participant = false;
Expand Down Expand Up @@ -154,8 +154,8 @@ EntityId DatabaseEntityQueue::process_participant(
}

graph_updated = database_->update_participant_in_graph(
info.domain_id, physical_entities_ids["host"], physical_entities_ids["user"],
physical_entities_ids["process"], participant_id);
info.domain_id, physical_entities_ids[HOST_ENTITY_TAG], physical_entities_ids[USER_ENTITY_TAG],
physical_entities_ids[PROCESS_ENTITY_TAG], participant_id);

if (graph_updated)
{
Expand Down
2 changes: 2 additions & 0 deletions src/cpp/database/database_queue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
#include <fastdds/rtps/common/RemoteLocators.hpp>
#include <fastdds/dds/log/Log.hpp>

#include <fastdds_statistics_backend/types/JSONTags.h>

#include <database/database.hpp>
#include <database/entities.hpp>
#include <exception/Exception.hpp>
Expand Down
Loading

0 comments on commit 3e1525c

Please sign in to comment.