holoscan::MessageLabel
holoscan::MessageLabel
Class to define a MessageLabel that is attached to every GXF Entity being communicated as a message between Operators in Holoscan, for Data Frame Flow Tracking.
A MessageLabel has a vector of paths, where each path is a vector of Operator references and their publish and receive timestamps. It also stores frame numbers for root operators.
Constructors
MessageLabel
Default
Copy (with m)
Copy (with m paths)
Assignment operators
operator=
Methods
num_paths
Get the number of paths in a MessageLabel.
Returns: The number of paths in a MessageLabel.
get_all_path_names
Get all the names of the path in formatted string, which is comma-separated values of the Operator names.
Returns: std::vector<std::string> The vector of strings, where each string is a path name.
paths
Mutable
Const
get_e2e_latency
Get the current end-to-end latency of a path in microseconds.
MessageLabel and the whole Data Flow Tracking component tracks the latency in microseconds, which is sufficient for our use-cases.
Returns: int64_t The current end-to-end latency of the index path in microseconds
Parameters
The index of the path for which to get the latency
get_e2e_latency_ms
Get the current end-to-end latency of a path in milliseconds.
Returns: double The current end-to-end latency of the index path in milliseconds.
Parameters
The index of the path for which to get the latency.
get_path
Get the Timestamped path at the given index.
Returns: TimestampedPath& The timestamped path at the given index
Parameters
The index of the path to get
get_path_name
Get the path name string which is comma-separated values of the operator names.
Returns: The path name string
Parameters
The index of the path to get
get_operator
Get the OperatorTimestampLabel at the given path and operator index.
Returns: OperatorTimestampLabel& The Operator reference at the given path and operator index
Parameters
The path index of the OperatorTimestampLabel to get
The Operator index of the OperatorTimestampLabel to get
set_operator_pub_timestamp
Set an Operator’s pub_timestamp.
Parameters
The path index of the Operator
The index of the Operator in the path
The new pub_timestamp to set
set_operator_rec_timestamp
Set an Operator’s pub_timestamp.
Parameters
The path index of the Operator
The index of the Operator in the path
The new rec_timestamp to set
has_operator
Check if an operator is present in the MessageLabel.
Returns an empty vector if the operator is not present in any path.
Returns: List of path indexes where the operator is present
Parameters
The name of the operator to check
set_frame_number
Set frame number for a specific root operator and port.
Parameters
The name of the root operator
The name of the output port
The frame number to set
get_frame_numbers
Get all frame numbers as a map.
Returns: Copy of the frame number map (thread-safe)
add_new_op_timestamp
Add a new Operator timestamp to all the paths in a message label.
Parameters
The new operator timestamp to be added
update_last_op_publish
Update the publish timestamp of the last operator in all the paths in a message label.
add_new_path
Add a new path to the MessageLabel
Overload 2
Add a new path to the MessageLabel.
Parameters
The path to be added.
to_string
Convert the MessageLabel to a string.
Returns: std::string The formatted string representing the MessageLabel with all the paths and the Operators with their publish and receive timestamps.
print_all
Print the to_string() in the standard output with a heading for the MessageLabel.
Static methods
get_path_e2e_latency_ms
Get the end-to-end latency of a TimestampedPath in microseconds.
It is a utility function in the class and not dependent on the object of this class. Therefore, it’s a static function.
Returns: The end-to-end latency of the path in ms
Parameters
The path for which to get the latency