NVIDIA Holoscan SDK v0.6
v0.6

Class MessageLabel

class 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.

Public Types

using TimestampedPath = std::vector<OperatorTimestampLabel>

Public Functions

inline MessageLabel()

inline MessageLabel(const MessageLabel &m)

inline MessageLabel &operator=(const MessageLabel &m)

inline int num_paths()

Get the number of paths in a MessageLabel.

Returns

The number of paths in a MessageLabel.

std::vector<std::string> 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.

inline std::vector<TimestampedPath> paths()

int64_t get_e2e_latency(int index)

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.

Parameters

index – the index of the path for which to get the latency

Returns

int64_t The current end-to-end latency of the index path in microseconds

inline double get_e2e_latency_ms(int index)

Get the current end-to-end latency of a path in milliseconds.

Parameters

index – The index of the path for which to get the latency.

Returns

double The current end-to-end latency of the index path in milliseconds.

TimestampedPath get_path(int index)

Get the Timestamped path at the given index.

Parameters

index – The index of the path to get

Returns

TimestampedPath& The timestamped path at the given index

OperatorTimestampLabel &get_operator(int path_index, int op_index)

Get the OperatorTimestampLabel at the given path and operator index.

Parameters
Returns

OperatorTimestampLabel& The Operator reference at the given path and operator index

void set_operator_pub_timestamp(int path_index, int op_index, int64_t pub_timestamp)

Set an Operator’s pub_timestamp.

Parameters
  • path_index – the path index of the Operator

  • op_index – the index of the Operator in the path

  • pub_timestamp – the new pub_timestamp to set

void set_operator_rec_timestamp(int path_index, int op_index, int64_t rec_timestamp)

Set an Operator’s pub_timestamp.

Parameters
  • path_index – the path index of the Operator

  • op_index – the index of the Operator in the path

  • rec_timestamp – the new rec_timestamp to set

void add_new_op_timestamp(holoscan::OperatorTimestampLabel o_timestamp)

Add a new Operator timestamp to all the paths in a message label.

Parameters

o_timestamp – The new operator timestamp to be added

void update_last_op_publish()

Update the publish timestamp of the last operator in all the paths in a message label.

inline void add_new_path(TimestampedPath path)

Add a new path to the MessageLabel.

Parameters

path – The path to be added.

std::string to_string() const

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.

void print_all()

Print the to_string() in the standard output with a heading for the MessageLabel.

© Copyright 2022-2023, NVIDIA. Last updated on Feb 9, 2024.