blob: 7ef338724ff8efb129f23e87cc371db2796b60b0 [file] [log] [blame]
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -08001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
2/*
3 * Copyright (c) 2011 UCLA
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
19 */
20
Alexander Afanasyev0c395372014-12-20 15:54:02 -080021#include "ndn-l3-rate-tracer.hpp"
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -080022#include "ns3/node.h"
23#include "ns3/packet.h"
24#include "ns3/config.h"
25#include "ns3/callback.h"
26#include "ns3/simulator.h"
27#include "ns3/log.h"
28#include "ns3/node-list.h"
29
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -080030#include <fstream>
31#include <boost/lexical_cast.hpp>
32
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080033NS_LOG_COMPONENT_DEFINE("ndn.L3RateTracer");
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -080034
35namespace ns3 {
36namespace ndn {
37
Spyridon Mastorakisda904f22014-11-05 16:23:33 -080038static std::list<std::tuple<shared_ptr<std::ostream>, std::list<Ptr<L3RateTracer>>>>
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080039 g_tracers;
Alexander Afanasyev3fe94dc2013-08-09 17:12:12 -070040
Alexander Afanasyev3fe94dc2013-08-09 17:12:12 -070041void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080042L3RateTracer::Destroy()
Alexander Afanasyevdb5f3b62013-08-09 17:42:12 -070043{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080044 g_tracers.clear();
Alexander Afanasyevdb5f3b62013-08-09 17:42:12 -070045}
46
47void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080048L3RateTracer::InstallAll(const std::string& file, Time averagingPeriod /* = Seconds (0.5)*/)
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -080049{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080050 std::list<Ptr<L3RateTracer>> tracers;
Spyridon Mastorakisda904f22014-11-05 16:23:33 -080051 shared_ptr<std::ostream> outputStream;
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080052 if (file != "-") {
Spyridon Mastorakisda904f22014-11-05 16:23:33 -080053 shared_ptr<std::ofstream> os(new std::ofstream());
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080054 os->open(file.c_str(), std::ios_base::out | std::ios_base::trunc);
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -080055
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080056 if (!os->is_open()) {
57 NS_LOG_ERROR("File " << file << " cannot be opened for writing. Tracing disabled");
58 return;
Alexander Afanasyev5352af32013-07-15 09:51:28 -070059 }
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -080060
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080061 outputStream = os;
62 }
63 else {
Spyridon Mastorakisda904f22014-11-05 16:23:33 -080064 outputStream = shared_ptr<std::ostream>(&std::cout, std::bind([]{}));
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080065 }
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -080066
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080067 for (NodeList::Iterator node = NodeList::Begin(); node != NodeList::End(); node++) {
68 Ptr<L3RateTracer> trace = Install(*node, outputStream, averagingPeriod);
69 tracers.push_back(trace);
70 }
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -080071
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080072 if (tracers.size() > 0) {
73 // *m_l3RateTrace << "# "; // not necessary for R's read.table
74 tracers.front()->PrintHeader(*outputStream);
75 *outputStream << "\n";
76 }
77
Spyridon Mastorakisda904f22014-11-05 16:23:33 -080078 g_tracers.push_back(std::make_tuple(outputStream, tracers));
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -080079}
80
Alexander Afanasyev3fe94dc2013-08-09 17:12:12 -070081void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080082L3RateTracer::Install(const NodeContainer& nodes, const std::string& file,
83 Time averagingPeriod /* = Seconds (0.5)*/)
Alexander Afanasyev5352af32013-07-15 09:51:28 -070084{
85 using namespace boost;
86 using namespace std;
87
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080088 std::list<Ptr<L3RateTracer>> tracers;
Spyridon Mastorakisda904f22014-11-05 16:23:33 -080089 shared_ptr<std::ostream> outputStream;
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080090 if (file != "-") {
Spyridon Mastorakisda904f22014-11-05 16:23:33 -080091 shared_ptr<std::ofstream> os(new std::ofstream());
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080092 os->open(file.c_str(), std::ios_base::out | std::ios_base::trunc);
Alexander Afanasyev5352af32013-07-15 09:51:28 -070093
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080094 if (!os->is_open()) {
95 NS_LOG_ERROR("File " << file << " cannot be opened for writing. Tracing disabled");
96 return;
Alexander Afanasyev5352af32013-07-15 09:51:28 -070097 }
98
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080099 outputStream = os;
100 }
101 else {
Spyridon Mastorakisda904f22014-11-05 16:23:33 -0800102 outputStream = shared_ptr<std::ostream>(&std::cout, std::bind([]{}));
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800103 }
Alexander Afanasyev5352af32013-07-15 09:51:28 -0700104
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800105 for (NodeContainer::Iterator node = nodes.Begin(); node != nodes.End(); node++) {
106 Ptr<L3RateTracer> trace = Install(*node, outputStream, averagingPeriod);
107 tracers.push_back(trace);
108 }
Alexander Afanasyev5352af32013-07-15 09:51:28 -0700109
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800110 if (tracers.size() > 0) {
111 // *m_l3RateTrace << "# "; // not necessary for R's read.table
112 tracers.front()->PrintHeader(*outputStream);
113 *outputStream << "\n";
114 }
115
Spyridon Mastorakisda904f22014-11-05 16:23:33 -0800116 g_tracers.push_back(std::make_tuple(outputStream, tracers));
Alexander Afanasyev5352af32013-07-15 09:51:28 -0700117}
118
Alexander Afanasyev3fe94dc2013-08-09 17:12:12 -0700119void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800120L3RateTracer::Install(Ptr<Node> node, const std::string& file,
121 Time averagingPeriod /* = Seconds (0.5)*/)
Alexander Afanasyev5352af32013-07-15 09:51:28 -0700122{
123 using namespace boost;
124 using namespace std;
125
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800126 std::list<Ptr<L3RateTracer>> tracers;
Spyridon Mastorakisda904f22014-11-05 16:23:33 -0800127 shared_ptr<std::ostream> outputStream;
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800128 if (file != "-") {
Spyridon Mastorakisda904f22014-11-05 16:23:33 -0800129 shared_ptr<std::ofstream> os(new std::ofstream());
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800130 os->open(file.c_str(), std::ios_base::out | std::ios_base::trunc);
Alexander Afanasyev5352af32013-07-15 09:51:28 -0700131
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800132 if (!os->is_open()) {
133 NS_LOG_ERROR("File " << file << " cannot be opened for writing. Tracing disabled");
134 return;
Alexander Afanasyev5352af32013-07-15 09:51:28 -0700135 }
136
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800137 outputStream = os;
138 }
139 else {
Spyridon Mastorakisda904f22014-11-05 16:23:33 -0800140 outputStream = shared_ptr<std::ostream>(&std::cout, std::bind([]{}));
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800141 }
Alexander Afanasyev5352af32013-07-15 09:51:28 -0700142
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800143 Ptr<L3RateTracer> trace = Install(node, outputStream, averagingPeriod);
144 tracers.push_back(trace);
Alexander Afanasyev5352af32013-07-15 09:51:28 -0700145
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800146 if (tracers.size() > 0) {
147 // *m_l3RateTrace << "# "; // not necessary for R's read.table
148 tracers.front()->PrintHeader(*outputStream);
149 *outputStream << "\n";
150 }
151
Spyridon Mastorakisda904f22014-11-05 16:23:33 -0800152 g_tracers.push_back(std::make_tuple(outputStream, tracers));
Alexander Afanasyev5352af32013-07-15 09:51:28 -0700153}
154
Alexander Afanasyev5352af32013-07-15 09:51:28 -0700155Ptr<L3RateTracer>
Spyridon Mastorakisda904f22014-11-05 16:23:33 -0800156L3RateTracer::Install(Ptr<Node> node, shared_ptr<std::ostream> outputStream,
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800157 Time averagingPeriod /* = Seconds (0.5)*/)
Alexander Afanasyev5352af32013-07-15 09:51:28 -0700158{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800159 NS_LOG_DEBUG("Node: " << node->GetId());
Alexander Afanasyev5352af32013-07-15 09:51:28 -0700160
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800161 Ptr<L3RateTracer> trace = Create<L3RateTracer>(outputStream, node);
162 trace->SetAveragingPeriod(averagingPeriod);
Alexander Afanasyev5352af32013-07-15 09:51:28 -0700163
164 return trace;
165}
166
Spyridon Mastorakisda904f22014-11-05 16:23:33 -0800167L3RateTracer::L3RateTracer(shared_ptr<std::ostream> os, Ptr<Node> node)
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800168 : L3Tracer(node)
169 , m_os(os)
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800170{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800171 SetAveragingPeriod(Seconds(1.0));
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800172}
173
Spyridon Mastorakisda904f22014-11-05 16:23:33 -0800174L3RateTracer::L3RateTracer(shared_ptr<std::ostream> os, const std::string& node)
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800175 : L3Tracer(node)
176 , m_os(os)
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800177{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800178 SetAveragingPeriod(Seconds(1.0));
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800179}
180
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800181L3RateTracer::~L3RateTracer()
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800182{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800183 m_printEvent.Cancel();
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800184}
185
186void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800187L3RateTracer::SetAveragingPeriod(const Time& period)
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800188{
189 m_period = period;
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800190 m_printEvent.Cancel();
191 m_printEvent = Simulator::Schedule(m_period, &L3RateTracer::PeriodicPrinter, this);
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800192}
193
194void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800195L3RateTracer::PeriodicPrinter()
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800196{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800197 Print(*m_os);
198 Reset();
Alexander Afanasyev37b84c52013-04-26 13:38:52 -0700199
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800200 m_printEvent = Simulator::Schedule(m_period, &L3RateTracer::PeriodicPrinter, this);
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800201}
202
203void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800204L3RateTracer::PrintHeader(std::ostream& os) const
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800205{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800206 os << "Time"
207 << "\t"
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800208
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800209 << "Node"
210 << "\t"
211 << "FaceId"
212 << "\t"
213 << "FaceDescr"
214 << "\t"
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800215
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800216 << "Type"
217 << "\t"
218 << "Packets"
219 << "\t"
220 << "Kilobytes"
221 << "\t"
222 << "PacketRaw"
223 << "\t"
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800224 << "KilobytesRaw";
225}
226
227void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800228L3RateTracer::Reset()
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800229{
Spyridon Mastorakisda904f22014-11-05 16:23:33 -0800230 for (std::map<shared_ptr<const Face>, std::tuple<Stats, Stats, Stats, Stats>>::iterator stats =
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800231 m_stats.begin();
232 stats != m_stats.end(); stats++) {
Spyridon Mastorakisda904f22014-11-05 16:23:33 -0800233 std::get<0>(stats->second).Reset();
234 std::get<1>(stats->second).Reset();
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800235 }
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800236}
237
238const double alpha = 0.8;
239
Spyridon Mastorakisda904f22014-11-05 16:23:33 -0800240#define STATS(INDEX) std::get<INDEX>(stats->second)
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800241#define RATE(INDEX, fieldName) STATS(INDEX).fieldName / m_period.ToDouble(Time::S)
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800242
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800243#define PRINTER(printName, fieldName) \
244 STATS(2).fieldName = \
245 /*new value*/ alpha * RATE(0, fieldName) + /*old value*/ (1 - alpha) * STATS(2).fieldName; \
246 STATS(3).fieldName = /*new value*/ alpha * RATE(1, fieldName) / 1024.0 \
247 + /*old value*/ (1 - alpha) * STATS(3).fieldName; \
248 \
249 os << time.ToDouble(Time::S) << "\t" << m_node << "\t"; \
Spyridon Mastorakisda904f22014-11-05 16:23:33 -0800250 if (stats->first != nullptr) { \
251 os << stats->first->getId() << "\t" << stats->first->getLocalUri() << "\t"; \
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800252 } \
253 else { \
254 os << "-1\tall\t"; \
255 } \
256 os << printName << "\t" << STATS(2).fieldName << "\t" << STATS(3).fieldName << "\t" \
257 << STATS(0).fieldName << "\t" << STATS(1).fieldName / 1024.0 << "\n";
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800258
259void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800260L3RateTracer::Print(std::ostream& os) const
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800261{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800262 Time time = Simulator::Now();
Alexander Afanasyev37b84c52013-04-26 13:38:52 -0700263
Spyridon Mastorakisda904f22014-11-05 16:23:33 -0800264 for (std::map<shared_ptr<const Face>, std::tuple<Stats, Stats, Stats, Stats>>::iterator stats =
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800265 m_stats.begin();
266 stats != m_stats.end(); stats++) {
Spyridon Mastorakisda904f22014-11-05 16:23:33 -0800267 if (stats->first == nullptr)
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800268 continue;
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800269
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800270 PRINTER("InInterests", m_inInterests);
271 PRINTER("OutInterests", m_outInterests);
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800272
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800273 PRINTER("InData", m_inData);
274 PRINTER("OutData", m_outData);
Alexander Afanasyevbf939292013-07-15 10:10:01 -0700275
Spyridon Mastorakisda904f22014-11-05 16:23:33 -0800276 // PRINTER("InSatisfiedInterests", m_satisfiedInterests);
277 // PRINTER("InTimedOutInterests", m_timedOutInterests);
Alexander Afanasyevbf939292013-07-15 10:10:01 -0700278
Spyridon Mastorakisda904f22014-11-05 16:23:33 -0800279 // PRINTER("OutSatisfiedInterests", m_outSatisfiedInterests);
280 // PRINTER("OutTimedOutInterests", m_outTimedOutInterests);
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800281 }
Alexander Afanasyev37b84c52013-04-26 13:38:52 -0700282
283 {
Spyridon Mastorakisda904f22014-11-05 16:23:33 -0800284 // std::map<shared_ptr<const Face>, boost::tuple<Stats, Stats, Stats, Stats>>::iterator stats =
285 // m_stats.find(shared_ptr<const Face>(0));
286 // if (stats != m_stats.end()) {
287 // PRINTER("SatisfiedInterests", m_satisfiedInterests);
288 // PRINTER("TimedOutInterests", m_timedOutInterests);
289 // }
Alexander Afanasyev37b84c52013-04-26 13:38:52 -0700290 }
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800291}
292
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800293void
Spyridon Mastorakisda904f22014-11-05 16:23:33 -0800294L3RateTracer::OutInterests(const Interest& interest, const Face& face)
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800295{
Spyridon Mastorakisda904f22014-11-05 16:23:33 -0800296 std::get<0>(m_stats[(const_cast<Face*>(&face))->shared_from_this()]).m_outInterests++;
297 if (interest.hasWire()) {
298 std::get<1>(m_stats[(const_cast<Face*>(&face))->shared_from_this()]).m_outInterests +=
299 interest.wireEncode().size();
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800300 }
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800301}
302
303void
Spyridon Mastorakisda904f22014-11-05 16:23:33 -0800304L3RateTracer::InInterests(const Interest& interest, const Face& face)
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800305{
Spyridon Mastorakisda904f22014-11-05 16:23:33 -0800306 std::get<0>(m_stats[(const_cast<Face*>(&face))->shared_from_this()]).m_inInterests++;
307 if (interest.hasWire()) {
308 std::get<1>(m_stats[(const_cast<Face*>(&face))->shared_from_this()]).m_inInterests +=
309 interest.wireEncode().size();
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800310 }
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800311}
312
313void
Spyridon Mastorakisda904f22014-11-05 16:23:33 -0800314L3RateTracer::OutData(const Data& data, const Face& face)
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800315{
Spyridon Mastorakisda904f22014-11-05 16:23:33 -0800316 std::get<0>(m_stats[(const_cast<Face*>(&face))->shared_from_this()]).m_outData++;
317 if (data.hasWire()) {
318 std::get<1>(m_stats[(const_cast<Face*>(&face))->shared_from_this()]).m_outData +=
319 data.wireEncode().size();
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800320 }
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800321}
322
323void
Spyridon Mastorakisda904f22014-11-05 16:23:33 -0800324L3RateTracer::InData(const Data& data, const Face& face)
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800325{
Spyridon Mastorakisda904f22014-11-05 16:23:33 -0800326 std::get<0>(m_stats[(const_cast<Face*>(&face))->shared_from_this()]).m_inData++;
327 if (data.hasWire()) {
328 std::get<1>(m_stats[(const_cast<Face*>(&face))->shared_from_this()]).m_inData +=
329 data.wireEncode().size();
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800330 }
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800331}
332
Spyridon Mastorakisda904f22014-11-05 16:23:33 -0800333// void
334// L3RateTracer::SatisfiedInterests (Ptr<const pit::Entry> entry)
335// {
336// m_stats[0].std::get<0> ().m_satisfiedInterests ++;
337// // no "size" stats
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800338
Spyridon Mastorakisda904f22014-11-05 16:23:33 -0800339// for (::nfd::pit::Entry::in_container::const_iterator i = entry->GetIncoming ().begin ();
340// i != entry->GetIncoming ().end ();
341// i++)
342// {
343// m_stats[i->m_face].std::get<0> ().m_satisfiedInterests ++;
344// }
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800345
Spyridon Mastorakisda904f22014-11-05 16:23:33 -0800346// for (::nfd::pit::Entry::out_container::const_iterator i = entry->GetOutgoing ().begin ();
347// i != entry->GetOutgoing ().end ();
348// i++)
349// {
350// m_stats[i->m_face].std::get<0> ().m_outSatisfiedInterests ++;
351// }
352// }
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800353
Spyridon Mastorakisda904f22014-11-05 16:23:33 -0800354// void
355// L3RateTracer::TimedOutInterests (Ptr<const pit::Entry> entry)
356// {
357// m_stats[0].std::get<0> ().m_timedOutInterests ++;
358// // no "size" stats
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800359
Spyridon Mastorakisda904f22014-11-05 16:23:33 -0800360// for (pit::Entry::in_container::const_iterator i = entry->GetIncoming ().begin ();
361// i != entry->GetIncoming ().end ();
362// i++)
363// {
364// m_stats[i->m_face].std::get<0> ().m_timedOutInterests ++;
365// }
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800366
Spyridon Mastorakisda904f22014-11-05 16:23:33 -0800367// for (pit::Entry::out_container::const_iterator i = entry->GetOutgoing ().begin ();
368// i != entry->GetOutgoing ().end ();
369// i++)
370// {
371// m_stats[i->m_face].std::get<0> ().m_outTimedOutInterests ++;
372// }
373// }
Alexander Afanasyev37b84c52013-04-26 13:38:52 -0700374
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800375} // namespace ndn
376} // namespace ns3