YARP
Yet Another Robot Platform
NetworkProfiler.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
10 
11 #include <yarp/os/Network.h>
12 #include <yarp/os/LogStream.h>
13 #include <yarp/os/ContactStyle.h>
14 #include <yarp/os/Port.h>
15 #include <yarp/os/OutputProtocol.h>
16 #include <yarp/os/Carrier.h>
17 #include <yarp/companion/impl/Companion.h>
18 
19 using namespace std;
20 using namespace yarp::os;
21 using namespace yarp::profiler;
22 using namespace yarp::profiler::graph;
23 
24 
25 
26 NetworkProfiler::ProgressCallback* NetworkProfiler::progCallback = nullptr;
27 
28 bool NetworkProfiler::yarpNameList(ports_name_set &ports, bool complete) {
29  ports.clear();
30 
31  ContactStyle style;
32  style.quiet = true;
33  style.timeout = 3.0;
34  string nameserver = NetworkBase::getNameServerName();
35  Bottle msg, reply;
36  msg.addString("bot");
37  msg.addString("list");
38  if(!NetworkBase::write(Contact(nameserver), msg, reply, style)) {
39  yError() << "Cannot write to yarp name server";
40  return false;
41  }
42 
43  if(reply.size() == 0) {
44  yError() << "Empty reply from yarp name server";
45  return false;
46  }
47 
48  for (size_t i=1; i<reply.size(); i++) {
49  Bottle *entry = reply.get(i).asList();
50  if(entry != nullptr) {
51  bool shouldTake = false;
52  std::string portname = entry->check("name", Value("")).asString();
53  if(complete)
54  {
55  shouldTake = portname != "";
56  }
57  else
58  {
59  shouldTake = portname != "" && portname != "fallback" && portname != nameserver;
60  }
61  if (shouldTake) {
62  Contact c = Contact::fromConfig(*entry);
63  if(c.getCarrier() != "mcast")
64  ports.push_back(*entry);
65  }
66  }
67  }
68 
69  return true;
70 }
71 
72 bool NetworkProfiler::getPortDetails(const string& portName, PortDetails& info) {
73 
74  info.name = portName;
75  Port ping;
76  ping.open("/yarpviz");
77  ping.setAdminMode(true);
78  ping.setTimeout(1.0);
79  if(!NetworkBase::connect(ping.getName(), portName)) {
80  yWarning()<<"Cannot connect to"<<portName;
81  ping.close();
82  return false;
83  }
84 
85  // Getting output connections list
86  Bottle cmd, reply;
87  cmd.addString("list"); cmd.addString("out");
88  if(!ping.write(cmd, reply)) {
89  yError()<<"Cannot write (list out) to"<<portName;
90  ping.close();
91  return false;
92  }
93  for(size_t i=0; i<reply.size(); i++) {
94  ConnectionInfo cnn;
95  cnn.name = reply.get(i).asString();
96  Bottle reply2;
97  cmd.clear();
98  cmd.addString("list"); cmd.addString("out"); cmd.addString(cnn.name);
99  if(!ping.write(cmd, reply2))
100  yWarning()<<"Cannot write (list out"<<cnn.name<<") to"<<portName;
101  else
102  cnn.carrier = reply2.find("carrier").asString();
103  info.outputs.push_back(cnn);
104  }
105 
106  // Getting input connections list
107  cmd.clear(); reply.clear();
108  cmd.addString("list"); cmd.addString("in");
109  if(!ping.write(cmd, reply)) {
110  yError()<<"Cannot write (list in) to"<<portName;
111  ping.close();
112  return false;
113  }
114  for(size_t i=0; i<reply.size(); i++) {
115  ConnectionInfo cnn;
116  cnn.name = reply.get(i).asString();
117  if(cnn.name != ping.getName())
118  info.inputs.push_back(cnn);
119  }
120 
121  // Getting owner info
122  cmd.clear(); reply.clear();
123  cmd.addString("prop"); cmd.addString("get"); cmd.addString(portName);
124  if(!ping.write(cmd, reply)) {
125  yError()<<"Cannot write (prop get"<<portName<<") to"<<portName;
126  ping.close();
127  return false;
128  }
129 
130  Property* process = reply.find("process").asDict();
131  if(!process)
132  yWarning()<<"Cannot find 'process' property of port "<<portName;
133  else {
134  info.owner.name = process->find("name").asString();
135  info.owner.arguments = process->find("arguments").asString();
136  info.owner.pid = process->find("pid").asInt32();
137  info.owner.priority = process->find("priority").asInt32();
138  info.owner.policy = process->find("policy").asInt32();
139  }
140 
141  Property* platform = reply.find("platform").asDict();
142  if(!platform)
143  yWarning()<<"Cannot find 'platform' property of port "<<portName;
144  else {
145  info.owner.os = platform->find("os").asString();
146  info.owner.hostname = platform->find("hostname").asString();
147  }
148 
149  ping.close();
150  return true;
151 }
152 
153 
154 bool NetworkProfiler::creatNetworkGraph(ports_detail_set details, yarp::profiler::graph::Graph& graph) {
155 
156  // adding the ports and processor nodes
157  if(NetworkProfiler::progCallback)
158  NetworkProfiler::progCallback->onProgress(0);
159 
161  unsigned int itr_count = 0;
162  for(itr = details.begin(); itr!=details.end(); itr++) {
163  PortDetails info = (*itr);
164 
165  // port node
166  PortVertex* port = new PortVertex(info.name);
167  if(!info.inputs.size() && !info.outputs.size())
168  port->property.put("orphan", true);
169  graph.insert(*port);
170 
171  //process node (owner)
172  ProcessVertex* process = new ProcessVertex(info.owner.pid, info.owner.hostname);
173  //prop.clear();
174  process->property.put("name", info.owner.name);
175  process->property.put("arguments", info.owner.arguments);
176  process->property.put("hostname", info.owner.hostname);
177  process->property.put("priority", info.owner.priority);
178  process->property.put("policy", info.owner.policy);
179  process->property.put("os", info.owner.os);
180  process->property.put("hidden", false);
181  auto itrVert=graph.insert(*process);
182  // create connection between ports and its process
183  if(dynamic_cast<ProcessVertex*> (*itrVert))
184  port->setOwner((ProcessVertex*)(*itrVert));
185 
186 
187 
188  //machine node (owner of the process)
189  MachineVertex* machine = new MachineVertex(info.owner.os, info.owner.hostname);
190  graph.insert(*machine);
191  //todo do the same done for the process.
192  process->setOwner(machine);
193 
194  if(!info.inputs.size() && !info.outputs.size())
195  graph.insertEdge(*process, *port, Property("(type ownership) (dir unknown)"));
196 
197  // calculate progress
198  if(NetworkProfiler::progCallback) {
199  NetworkProfiler::progCallback->onProgress((unsigned int) (++itr_count/((float)(details.size()*2)) * 100.0) );
200  }
201  }
202 
203 
204  // create connection between ports
205  for(itr = details.begin(); itr!=details.end(); itr++) {
206  PortDetails info = (*itr);
207  // find the current port vertex in the graph
208  pvertex_iterator vi1 = graph.find(PortVertex(info.name));
209  yAssert(vi1 != graph.vertices().end());
210  for(auto cnn : info.outputs) {
211  pvertex_iterator vi2 = graph.find(PortVertex(cnn.name));
212  if(vi2 != graph.vertices().end()) {
213  //yInfo()<<"connecting "<<(*vi1)->property.find("name").asString()<<"->"<<(*vi2)->property.find("name").asString();
214  Property edge_prop("(type connection)");
215  edge_prop.put("carrier", cnn.carrier);
216  graph.insertEdge(vi1, vi2, edge_prop);
217  }
218  else
219  yWarning()<<"Found a nonexistent port ("<<cnn.name<<")"<<"in the output list of"<<(*vi1)->property.find("name").asString();
220  }
221  // calculate progress
222  if(NetworkProfiler::progCallback) {
223  NetworkProfiler::progCallback->onProgress((unsigned int) (++itr_count/((float)(details.size()*2)) * 100.0) );
224  }
225  }
226  if(NetworkProfiler::progCallback)
227  NetworkProfiler::progCallback->onProgress(100); // is it really needed? :p
228  return true;
229 }
230 
231 bool NetworkProfiler::yarpClean(float timeout) {
232 
233  if (timeout <= 0)
234  timeout = -1;
235 
236  stringstream sstream;
237  sstream<<timeout;
238  char* argv[2];
239  argv[0] = (char*) "--timeout";
240  argv[1] = (char*) sstream.str().c_str();
241  yarp::companion::impl::Companion::getInstance().cmdClean(2,argv);
242  return true;
243 }
244 
245 bool NetworkProfiler::creatSimpleModuleGraph(yarp::profiler::graph::Graph& graph, yarp::profiler::graph::Graph& subgraph) {
246  subgraph.clear();
248  const pvertex_set& vertices = graph.vertices();
249  //insert machines
250  for(itr = vertices.begin(); itr!=vertices.end(); itr++) {
251 
252  if(!dynamic_cast<MachineVertex*>(*itr))
253  continue;
254  else
255  {
256  auto* mv1 = dynamic_cast<MachineVertex*>(*itr);
257  if (mv1)
258  {
259  MachineVertex* mv2 = new MachineVertex(mv1->property.find("os").asString(),
260  mv1->property.find("hostname").asString());
261  mv2->property = mv1->property;
262  subgraph.insert(*mv2);
263  }
264  }
265  }
266 
267  for(itr = vertices.begin(); itr!=vertices.end(); itr++) {
268  if(!dynamic_cast<ProcessVertex*>(*itr))
269  continue;
270  auto* pv1 = dynamic_cast<ProcessVertex*>(*itr);
271  if (pv1)
272  {
273  ProcessVertex* pv2 = new ProcessVertex(pv1->property.find("pid").asInt32(),
274  pv1->property.find("hostname").asString());
275  pv2->property = pv1->property;
276  subgraph.insert(*pv2);
277  }
278  }
279  // insert edges
280  for(itr = vertices.begin(); itr!=vertices.end(); itr++) {
281  if(!dynamic_cast<ProcessVertex*>(*itr))
282  continue;
283  Vertex* v1 = (*itr);
284  const edge_set& outs = v1->outEdges();
285  edge_const_iterator eitr;
286  for(eitr = outs.begin(); eitr!=outs.end(); eitr++) {
287  const Edge& e = (*eitr);
288  const Vertex& p1 = e.second();
289 
290  const edge_set& pouts = p1.outEdges();
291  edge_const_iterator peitr;
292  for(peitr = pouts.begin(); peitr!=pouts.end(); peitr++) {
293  const Vertex& p2 = (*peitr).second();
294  Property prop((*peitr).property);
295  string label = p1.property.find("name").asString();
296  label.append(" - ").append(p2.property.find("name").asString());
297  prop.put("label", label);
298  subgraph.insertEdge(*v1, p2.outEdges()[0].second(), prop);
299  }
300  }
301  }
302  return true;
303 }
304 
305 std::string NetworkProfiler::packetPrioToString(yarp::os::QosStyle::PacketPriorityLevel level) {
306  std::string name;
307  switch(level) {
309  name = "NORMAL";
310  break;
311  }
313  name = "LOW";
314  break;
315  }
317  name = "HIGH";
318  break;
319  }
321  name = "CRITIC";
322  break;
323  }
325  name = "INVALID";
326  break;
327  }
328  default: {
329  name = "UNDEFINED";
330  }
331  };
332  return name;
333 }
334 
335 yarp::os::QosStyle::PacketPriorityLevel NetworkProfiler::packetStringToPrio(std::string level) {
336  if(level=="NORMAL") return yarp::os::QosStyle::PacketPriorityNormal;
337  if(level=="LOW") return yarp::os::QosStyle::PacketPriorityLow;
338  if(level=="HIGH") return yarp::os::QosStyle::PacketPriorityHigh;
339  if(level=="CRITIC") return yarp::os::QosStyle::PacketPriorityCritical;
340  if(level=="INVALID") return yarp::os::QosStyle::PacketPriorityInvalid;
342 }
343 
344 bool NetworkProfiler::updateConnectionQosStatus(yarp::profiler::graph::Graph& graph) {
345  // adding all process nodes and subgraphs
347  const pvertex_set& vertices = graph.vertices();
348 
349  for(itr = vertices.begin(); itr!=vertices.end(); itr++) {
350  const Vertex &v1 = (**itr);
351  for(const auto& i : v1.outEdges()) {
352  Edge& edge = (Edge&) i;
353  const Vertex &v2 = edge.second();
354  if(!v1.property.check("hidden") && !v2.property.check("hidden")) {
355  if(edge.property.find("type").asString() == "connection") {
356  //yInfo()<<v1.property.find("name").asString()<<"->"<<v2.property.find("name").asString()<<label;
357  yarp::os::QosStyle fromStyle, toStyle;
359  v2.property.find("name").asString(), fromStyle, toStyle)) {
360  // source
361  edge.property.put("FromThreadPriority", fromStyle.getThreadPriority());
362  edge.property.put("FromThreadPolicy", fromStyle.getThreadPolicy());
363  edge.property.put("FromPacketPriority", fromStyle.getPacketPriorityAsLevel());
364  edge.property.put("ToThreadPriority", toStyle.getThreadPriority());
365  edge.property.put("ToThreadPolicy", toStyle.getThreadPolicy());
366  edge.property.put("ToPacketPriority", toStyle.getPacketPriorityAsLevel());
367  }
368  else
369  yWarning()<<"Cannot retrieve Qos property of"<<v1.property.find("name").asString()<<"->"<<v2.property.find("name").asString();
370  }
371  }
372  }
373  }
374  return true;
375 }
376 
377 bool NetworkProfiler::attachPortmonitorPlugin(std::string portName, yarp::os::Property pluginProp) {
378 
379  //e.g., atch in "(context yarpviz) (file portrate)"
380  yarp::os::Bottle cmd, reply;
381  cmd.addString("atch");
382  cmd.addString("in");
383  cmd.addString(pluginProp.toString());
384  //Property& prop = cmd.addDict();
385  //prop.fromString(pluginProp.toString());
386  //yInfo()<<cmd.toString();
387  Contact srcCon = Contact::fromString(portName);
388  bool ret = yarp::os::NetworkBase::write(srcCon, cmd, reply, true, true, 2.0);
389  if(!ret) {
390  yError()<<"Cannot write to"<<portName;
391  return false;
392  }
393  if(reply.get(0).asString() != "ok") {
394  yError()<<reply.toString();
395  return false;
396  }
397 
398  return true;
399 
400 }
401 
402 bool NetworkProfiler::detachPortmonitorPlugin(std::string portName) {
403  //e.g., dtch in
404  yarp::os::Bottle cmd, reply;
405  cmd.addString("dtch");
406  cmd.addString("in");
407  Contact srcCon = Contact::fromString(portName);
408  bool ret = yarp::os::NetworkBase::write(srcCon, cmd, reply, true, true, 2.0);
409  if(!ret) {
410  yError()<<"Cannot write to"<<portName;
411  return false;
412  }
413  if(reply.get(0).asString() != "ok") {
414  yError()<<reply.toString();
415  return false;
416  }
417  return true;
418 }
419 
420 bool NetworkProfiler::setPortmonitorParams(std::string portName, yarp::os::Property& param) {
421  //e.g., set in "/view" (log_raw 1)"
422  yarp::os::Bottle cmd, reply;
423  cmd.addString("set");
424  cmd.addString("in");
425  cmd.addString(portName.c_str());
426  Bottle tmp;
427  tmp.fromString(param.toString());
428  cmd.add(tmp.get(0));
429  Contact srcCon = Contact::fromString(portName);
430  bool ret = yarp::os::NetworkBase::write(srcCon, cmd, reply, true, true, 2.0);
431  if(!ret) {
432  yError()<<"Cannot write to"<<portName;
433  return false;
434  }
435  if(reply.size() > 1) {
436  if(reply.get(0).isString() && reply.get(0).asString() == "fail") {
437  yError()<<reply.toString();
438  return false;
439  }
440  else if(reply.get(0).isInt32() && reply.get(0).asInt32() == -1) {
441  yError()<<reply.toString();
442  return false;
443  }
444  }
445  return true;
446 }
447 
448 bool NetworkProfiler::getPortmonitorParams(std::string portName, yarp::os::Bottle& param) {
449  //e.g., get in /portname"
450  yarp::os::Bottle cmd;
451  cmd.addString("get");
452  cmd.addString("in");
453  cmd.addString(portName.c_str());
454  Contact srcCon = Contact::fromString(portName);
455  bool ret = yarp::os::NetworkBase::write(srcCon, cmd, param, true, true, 2.0);
456  if(!ret) {
457  yError()<<"Cannot write to"<<portName;
458  return false;
459  }
460  if(param.size() > 1) {
461  if(param.get(0).isString() && param.get(0).asString() == "fail") {
462  yError()<<param.toString();
463  return false;
464  }
465  else if(param.get(0).isInt32() && param.get(0).asInt32() == -1) {
466  yError()<<param.toString();
467  return false;
468  }
469  }
470  return true;
471 }
yarp::os::Port::close
void close() override
Stop port activity.
Definition: Port.cpp:357
LogStream.h
yarp::profiler::graph::Graph::find
const pvertex_iterator find(const Vertex &v1)
Definition: Graph.cpp:155
yarp::os::Bottle
A simple collection of objects that can be described and transmitted in a portable way.
Definition: Bottle.h:73
yarp::profiler::graph::MachineVertex
Definition: Graph.h:218
yarp::profiler::graph::Vertex::property
yarp::os::Property property
Definition: Graph.h:96
yarp::os::QosStyle::PacketPriorityLow
@ PacketPriorityLow
Definition: QosStyle.h:36
yarp::os::Bottle::toString
std::string toString() const override
Gives a human-readable textual representation of the bottle.
Definition: Bottle.cpp:214
yarp::os::Property::put
void put(const std::string &key, const std::string &value)
Associate the given key with the given string.
Definition: Property.cpp:998
pvertex_const_iterator
pvertex_set::const_iterator pvertex_const_iterator
Definition: Graph.h:42
yarp::os::Bottle::clear
void clear()
Empties the bottle of any objects it contains.
Definition: Bottle.cpp:124
Network.h
yarp::profiler::graph::Graph::insert
pvertex_iterator insert(const Vertex &vertex)
Definition: Graph.cpp:119
yarp::profiler::NetworkProfiler::PortDetails
Definition: NetworkProfiler.h:65
yarp::os::ContactStyle
Preferences for how to communicate with a contact.
Definition: ContactStyle.h:27
yarp::os::Value::asDict
virtual Property * asDict() const
Get dictionary (hash table) value.
Definition: Value.cpp:249
yarp::profiler::NetworkProfiler::ProcessInfo::arguments
std::string arguments
Definition: NetworkProfiler.h:54
yarp::os::QosStyle
Preferences for the port's Quality of Service.
Definition: QosStyle.h:26
yarp::profiler::NetworkProfiler::ports_name_set
std::vector< yarp::os::Bottle > ports_name_set
Definition: NetworkProfiler.h:92
yarp::os::Bottle::size
size_type size() const
Gets the number of elements in the bottle.
Definition: Bottle.cpp:254
yarp::profiler::graph::OwnedVertex::setOwner
bool setOwner(yarp::profiler::graph::Vertex *_owner)
Definition: Graph.h:173
yarp::os::NetworkBase::getConnectionQos
static bool getConnectionQos(const std::string &src, const std::string &dest, QosStyle &srcStyle, QosStyle &destStyle, bool quiet=true)
Gets the Qos preferences of a connection.
Definition: Network.cpp:1192
yarp::profiler::NetworkProfiler::PortDetails::inputs
std::vector< ConnectionInfo > inputs
Definition: NetworkProfiler.h:68
ContactStyle.h
Port.h
yarp::os::NetworkBase::write
static bool write(const Contact &contact, PortWriter &cmd, PortReader &reply, bool admin=false, bool quiet=false, double timeout=-1)
Send a single command to a port and await a single response.
Definition: Network.cpp:1229
yarp::os::QosStyle::getThreadPriority
int getThreadPriority() const
returns the communication thread priority level
Definition: QosStyle.h:174
yarp::profiler::graph::Graph::vertices
const pvertex_set & vertices()
Definition: Graph.h:133
yarp::profiler::NetworkProfiler::ProcessInfo::priority
int priority
Definition: NetworkProfiler.h:59
yarp::profiler::NetworkProfiler::PortDetails::name
std::string name
Definition: NetworkProfiler.h:66
yarp::os::QosStyle::getThreadPolicy
int getThreadPolicy() const
returns the communication thread scheduling policy
Definition: QosStyle.h:184
yarp::profiler::graph::Vertex
The yarp::profiler::graph::Vertex class.
Definition: Graph.h:79
yarp::os::Port::setAdminMode
void setAdminMode(bool adminMode=true)
Turn on/off "admin" mode.
Definition: Port.cpp:589
yarp::os::Bottle::fromString
void fromString(const std::string &text)
Initializes bottle from a string.
Definition: Bottle.cpp:207
yarp::os::Property::find
Value & find(const std::string &key) const override
Gets a value corresponding to a given keyword.
Definition: Property.cpp:1034
yarp::os::Port::open
bool open(const std::string &name) override
Start port operation, with a specific name, with automatically-chosen network parameters.
Definition: Port.cpp:82
ret
bool ret
Definition: ImplementAxisInfo.cpp:72
yarp::profiler::NetworkProfiler::ConnectionInfo::carrier
std::string carrier
Definition: NetworkProfiler.h:41
yarp::profiler::graph::Edge
The yarp::profiler::graph::Edge class.
Definition: Graph.h:52
yError
#define yError(...)
Definition: Log.h:282
yarp::profiler::graph::PortVertex
Definition: Graph.h:188
yarp::os::Bottle::find
Value & find(const std::string &key) const override
Gets a value corresponding to a given keyword.
Definition: Bottle.cpp:290
yarp::profiler::NetworkProfiler::ConnectionInfo
Definition: NetworkProfiler.h:39
yarp::profiler::NetworkProfiler::PortDetails::owner
ProcessInfo owner
Definition: NetworkProfiler.h:69
yarp::profiler::NetworkProfiler::ports_detail_iterator
ports_detail_set::iterator ports_detail_iterator
Definition: NetworkProfiler.h:96
yarp::os::Port
A mini-server for network communication.
Definition: Port.h:50
yarp::os::Bottle::check
bool check(const std::string &key) const override
Check if there exists a property of the given name.
Definition: Bottle.cpp:280
yarp::profiler::NetworkProfiler::ports_detail_set
std::vector< PortDetails > ports_detail_set
Definition: NetworkProfiler.h:95
yarp::os::QosStyle::getPacketPriorityAsLevel
PacketPriorityLevel getPacketPriorityAsLevel() const
returns the packet TOS value
Definition: QosStyle.cpp:134
yarp::os::Value::isString
virtual bool isString() const
Checks if value is a string.
Definition: Value.cpp:159
yarp::profiler::NetworkProfiler::ProgressCallback::onProgress
virtual void onProgress(unsigned int percentage)
Definition: NetworkProfiler.h:35
yarp::profiler::graph::Edge::property
yarp::os::Property property
Definition: Graph.h:68
yarp::profiler::graph
Definition: Graph.h:20
yarp::profiler::graph::ProcessVertex
Definition: Graph.h:202
yarp::os::QosStyle::PacketPriorityHigh
@ PacketPriorityHigh
Definition: QosStyle.h:37
yarp::os::Bottle::get
Value & get(size_type index) const
Reads a Value v from a certain part of the list.
Definition: Bottle.cpp:249
yarp::os::ContactStyle::quiet
bool quiet
Suppress all outputs and warnings.
Definition: ContactStyle.h:39
yarp::os::Property::toString
std::string toString() const override
Return a standard text representation of the content of the object.
Definition: Property.cpp:1052
yarp::os::QosStyle::PacketPriorityCritical
@ PacketPriorityCritical
Definition: QosStyle.h:38
yarp::os::Contact::getCarrier
std::string getCarrier() const
Get the carrier associated with this Contact for socket communication.
Definition: Contact.cpp:253
yarp::os::Value::asString
virtual std::string asString() const
Get string value.
Definition: Value.cpp:237
yarp::profiler::NetworkProfiler::ConnectionInfo::name
std::string name
Definition: NetworkProfiler.h:40
yarp::profiler::NetworkProfiler::ProcessInfo::policy
int policy
Definition: NetworkProfiler.h:60
pvertex_set
std::vector< yarp::profiler::graph::Vertex * > pvertex_set
Definition: Graph.h:40
yarp::os::Port::setTimeout
bool setTimeout(float timeout)
Set a timeout on network operations.
Definition: Port.cpp:628
yWarning
#define yWarning(...)
Definition: Log.h:271
yarp::os::Property::check
bool check(const std::string &key) const override
Check if there exists a property of the given name.
Definition: Property.cpp:1024
NetworkProfiler.h
yarp::os::Contactable::getName
virtual std::string getName() const
Get name of port.
Definition: Contactable.cpp:17
yarp::profiler::NetworkProfiler::ProcessInfo::pid
int pid
Definition: NetworkProfiler.h:58
yarp::os::Bottle::addString
void addString(const char *str)
Places a string in the bottle, at the end of the list.
Definition: Bottle.cpp:173
yarp::os::QosStyle::PacketPriorityNormal
@ PacketPriorityNormal
Definition: QosStyle.h:35
yarp::profiler::graph::Vertex::outEdges
const edge_set & outEdges() const
Definition: Graph.h:86
yarp::os::Value::asInt32
virtual std::int32_t asInt32() const
Get 32-bit integer value.
Definition: Value.cpp:207
yarp::profiler::NetworkProfiler::ProgressCallback
Definition: NetworkProfiler.h:32
yarp::os::Port::write
bool write(const PortWriter &writer, const PortWriter *callback=nullptr) const override
Write an object to the port.
Definition: Port.cpp:430
Carrier.h
yarp::os
An interface to the operating system, including Port based communication.
Definition: AbstractCarrier.h:17
edge_const_iterator
edge_set::const_iterator edge_const_iterator
Definition: Graph.h:38
yarp::os::Contact
Represents how to reach a part of a YARP network.
Definition: Contact.h:39
yarp::os::QosStyle::PacketPriorityLevel
PacketPriorityLevel
The PacketPriorityLevel defines the packets quality of service (priority) levels.
Definition: QosStyle.h:33
yarp::os::Value::asList
virtual Bottle * asList() const
Get list value.
Definition: Value.cpp:243
yarp::profiler::graph::Graph
The yarp::profiler::graph::Graph class.
Definition: Graph.h:111
yarp::profiler::NetworkProfiler::PortDetails::outputs
std::vector< ConnectionInfo > outputs
Definition: NetworkProfiler.h:67
yarp::os::ContactStyle::timeout
double timeout
Set a timeout for communication (in units of seconds, fractional seconds allowed).
Definition: ContactStyle.h:50
yarp::os::Bottle::add
void add(const Value &value)
Add a Value to the bottle, at the end of the list.
Definition: Bottle.cpp:339
yarp::profiler::graph::Graph::clear
void clear()
Definition: Graph.cpp:178
yarp::sig::file::write
bool write(const ImageOf< PixelRgb > &src, const std::string &dest, image_fileformat format=FORMAT_PPM)
Definition: ImageFile.cpp:971
yarp::os::Value
A single value (typically within a Bottle).
Definition: Value.h:47
yarp::profiler
Definition: Graph.h:19
yAssert
#define yAssert(x)
Definition: Log.h:297
yarp::os::QosStyle::PacketPriorityInvalid
@ PacketPriorityInvalid
Definition: QosStyle.h:34
yarp::profiler::NetworkProfiler::ProcessInfo::name
std::string name
Definition: NetworkProfiler.h:53
yarp::profiler::NetworkProfiler::ProcessInfo::os
std::string os
Definition: NetworkProfiler.h:55
edge_set
std::vector< yarp::profiler::graph::Edge > edge_set
Definition: Graph.h:36
yarp::profiler::graph::Edge::second
const yarp::profiler::graph::Vertex & second() const
Definition: Graph.cpp:47
yarp::profiler::graph::Graph::insertEdge
void insertEdge(const Vertex &v1, const Vertex &v2, const yarp::os::Property &property="")
Definition: Graph.cpp:139
yarp::profiler::NetworkProfiler::ProcessInfo::hostname
std::string hostname
Definition: NetworkProfiler.h:56
yarp::os::Property
A class for storing options and configuration information.
Definition: Property.h:37
OutputProtocol.h
pvertex_iterator
pvertex_set::iterator pvertex_iterator
Definition: Graph.h:41
yarp::os::Value::isInt32
virtual bool isInt32() const
Checks if value is a 32-bit integer.
Definition: Value.cpp:135