blob: cce98d9380c4fd34040a1c652a5b37ef78da379a [file] [log] [blame]
Alexander Afanasyevb1314b12012-11-21 18:23:42 -08001
2Obtaining metrics
3=================
4
5To obtain simulation results, you would need to connect to one or more `trace sources <doxygen/group___trace_source_list.html>`_ provided by ndnSIM classes.
6
7
8Tracer classes
9--------------
10
11ndnSIM provides a few helper tracers that simplify process of obtaining metrics.
12
13Currently, there are only 2 useful tracers:
14
15- :ndnsim:`ndn::L3AggregateTracer`
16
17 Tracing the aggregate number of Interests/Data packets forwarded by an NDN node
18
19 The following example enables tracing on all simulation nodes:
20
21 .. code-block:: c++
22
23 // the following should be put just before calling Simulator::Run in the scenario
24
25 boost::tuple< boost::shared_ptr<std::ostream>, std::list<Ptr<L3AggregateTracer> > >
26 tracers = L3RateTracer::InstallAll ("aggregate-trace.txt", Seconds (1.0));
27
28 Simulator::Run ();
29
30
31- :ndnsim:`ndn::L3RateTracer`
32
33 Tracing the rate in bytes and in number of packets of Interest/Data packets forwarded by an NDN node
34
35 The following example enables tracing on all simulation nodes:
36
37 .. code-block:: c++
38
39 // the following should be put just before calling Simulator::Run in the scenario
40
41 boost::tuple< boost::shared_ptr<std::ostream>, std::list<Ptr<L3RateTracer> > >
42 tracers = L3RateTracer::InstallAll ("rate-trace.txt", Seconds (1.0));
43
44 Simulator::Run ();
45
46
47.. note::
48
49 A number of other tracers are available in ``plugins/tracers-broken`` folder, but they do not yet work with the current code.
50 Eventually, we will port most of them to the current code, but it is not our main priority at the moment and would really appreciate help with writing new tracers and porting the old ones.
51
52