16 const QString ros_node_name =
22 index_[ros_node_name].clear();
24 for (
auto const &item : msg.data) {
36 if (!label.startsWith(ros_node_name)) {
37 label = ros_node_name + label;
41 index_[ros_node_name][item.key] = label;
47 const swri_profiler_msgs::ProfileDataArray &msg)
49 const QString node_name(QString::fromStdString(msg.header.frame_id));
51 if (
index_.count(node_name) == 0) {
52 qWarning(
"No index for node '%s'. Dropping data update.", qPrintable(node_name));
56 int timestamp_sec = std::round(msg.header.stamp.toSec());
59 out.reserve(msg.data.size());
60 for (
auto const &item : msg.data) {
61 if (
index_[node_name].count(item.key) == 0) {
62 qWarning(
"No index for block %d of %s. Dropping all data " 63 "because index is probably invalid.",
64 item.key, qPrintable(node_name));
69 out.back().label =
index_[node_name][item.key];
70 out.back().wall_stamp_sec = timestamp_sec;
71 out.back().ros_stamp_ns = msg.rostime_stamp.toNSec();
72 out.back().cumulative_call_count = item.abs_call_count;
73 out.back().cumulative_inclusive_duration_ns = item.abs_total_duration.toNSec();
74 out.back().incremental_inclusive_duration_ns = item.rel_total_duration.toNSec();
75 out.back().incremental_max_duration_ns = item.rel_max_duration.toNSec();
78 out_data.insert(out_data.end(), out.begin(), out.end());