Skip to content

Commit

Permalink
fw: increment nOutNacks when sending a Nack from onInterestLoop
Browse files Browse the repository at this point in the history
Also expand test coverage of all forwarder counters

Change-Id: I6948af05aca1b5589e2f1c8a1f23c002d39d0ec0
  • Loading branch information
Pesa committed Aug 3, 2023
1 parent 653eb07 commit 95afc6d
Show file tree
Hide file tree
Showing 3 changed files with 190 additions and 66 deletions.
5 changes: 3 additions & 2 deletions daemon/fw/forwarder-counters.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2020, Regents of the University of California,
* Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
Expand Down Expand Up @@ -30,7 +30,8 @@

namespace nfd {

/** \brief Counters provided by Forwarder
/**
* \brief Counters provided by Forwarder.
*/
class ForwarderCounters
{
Expand Down
2 changes: 2 additions & 0 deletions daemon/fw/forwarder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ Forwarder::onInterestLoop(const Interest& interest, const FaceEndpoint& ingress)
lp::Nack nack(interest);
nack.setReason(lp::NackReason::DUPLICATE);
ingress.face.sendNack(nack);
++m_counters.nOutNacks;
}

void
Expand Down Expand Up @@ -271,6 +272,7 @@ Forwarder::onOutgoingInterest(const Interest& interest, Face& egress,
// send Interest
egress.sendInterest(interest);
++m_counters.nOutInterests;

return &*it;
}

Expand Down
Loading

0 comments on commit 95afc6d

Please sign in to comment.