NFD 24.07-35-g23c53535
Loading...
Searching...
No Matches
nfd::face::FaceCounters Class Reference

Gives access to the counters provided by Face. More...

#include <daemon/face/face.hpp>

+ Collaboration diagram for nfd::face::FaceCounters:

Public Member Functions

 FaceCounters (const LinkService::Counters &linkServiceCounters, const Transport::Counters &transportCounters)
 
template<typename T >
std::enable_if_t< std::is_base_of_v< LinkService::Counters, T >, const T & > get () const
 Returns the counters provided by (a subclass of) LinkService.
 
template<typename T >
std::enable_if_t< std::is_base_of_v< Transport::Counters, T >, const T & > get () const
 Returns the counters provided by (a subclass of) Transport.
 

Public Attributes

const ByteCounter & nInBytes
 Total bytes received.
 
const PacketCounter & nInData
 Count of incoming Data packets.
 
PacketCounter nInHopLimitZero
 Count of incoming Interests dropped due to HopLimit == 0.
 
const PacketCounter & nInInterests
 Count of incoming Interest packets.
 
const PacketCounter & nInNacks
 Count of incoming Nack packets.
 
const PacketCounter & nInPackets
 Count of incoming packets.
 
const PacketCounter & nInterestsExceededRetx
 Count of Interests dropped by reliability system for exceeding allowed number of retx.
 
const ByteCounter & nOutBytes
 Total bytes sent.
 
const PacketCounter & nOutData
 Count of outgoing Data packets.
 
PacketCounter nOutHopLimitZero
 Count of outgoing Interests dropped due to HopLimit == 0 on non-local faces.
 
const PacketCounter & nOutInterests
 Count of outgoing Interest packets.
 
const PacketCounter & nOutNacks
 Count of outgoing Nack packets.
 
const PacketCounter & nOutPackets
 Count of outgoing packets.
 

Detailed Description

Gives access to the counters provided by Face.

This type is a facade that exposes common counters of a Face.

get<T>() can be used to access extended counters provided by LinkService or Transport of the Face.

Definition at line 51 of file face.hpp.

Constructor & Destructor Documentation

◆ FaceCounters()

nfd::face::FaceCounters::FaceCounters ( const LinkService::Counters &  linkServiceCounters,
const Transport::Counters &  transportCounters 
)

Definition at line 30 of file face.cpp.

Member Function Documentation

◆ get() [1/2]

template<typename T >
std::enable_if_t< std::is_base_of_v< LinkService::Counters, T >, const T & > nfd::face::FaceCounters::get ( ) const
inline

Returns the counters provided by (a subclass of) LinkService.

Template Parameters
TThe desired counters type
Exceptions
std::bad_castcounters type mismatch

Definition at line 64 of file face.hpp.

◆ get() [2/2]

template<typename T >
std::enable_if_t< std::is_base_of_v< Transport::Counters, T >, const T & > nfd::face::FaceCounters::get ( ) const
inline

Returns the counters provided by (a subclass of) Transport.

Template Parameters
TThe desired counters type
Exceptions
std::bad_castcounters type mismatch

Definition at line 76 of file face.hpp.

Member Data Documentation

◆ nInBytes

const ByteCounter& nfd::face::FaceCounters::nInBytes

Total bytes received.

This counter includes headers imposed by NFD (such as NDNLP), but excludes the overhead of the underlying protocol (such as IP header).

For a datagram-based transport, an incoming packet that cannot be parsed as TLV will not be counted.

Definition at line 92 of file face.hpp.

◆ nInData

const PacketCounter& nfd::face::FaceCounters::nInData

Count of incoming Data packets.

Definition at line 85 of file face.hpp.

◆ nInHopLimitZero

PacketCounter nfd::face::FaceCounters::nInHopLimitZero

Count of incoming Interests dropped due to HopLimit == 0.

Definition at line 96 of file face.hpp.

◆ nInInterests

const PacketCounter& nfd::face::FaceCounters::nInInterests

Count of incoming Interest packets.

Definition at line 82 of file face.hpp.

◆ nInNacks

const PacketCounter& nfd::face::FaceCounters::nInNacks

Count of incoming Nack packets.

Definition at line 87 of file face.hpp.

◆ nInPackets

const PacketCounter& nfd::face::FaceCounters::nInPackets

Count of incoming packets.

A 'packet' typically means a top-level TLV element.

For a datagram-based transport, an incoming packet that cannot be parsed as TLV will not be counted.

Definition at line 90 of file face.hpp.

◆ nInterestsExceededRetx

const PacketCounter& nfd::face::FaceCounters::nInterestsExceededRetx

Count of Interests dropped by reliability system for exceeding allowed number of retx.

Definition at line 84 of file face.hpp.

◆ nOutBytes

const ByteCounter& nfd::face::FaceCounters::nOutBytes

Total bytes sent.

This counter includes headers imposed by NFD (such as NDNLP), but excludes the overhead of the underlying protocol (such as IP header).

This counter is increased only when the transport is UP.

Definition at line 93 of file face.hpp.

◆ nOutData

const PacketCounter& nfd::face::FaceCounters::nOutData

Count of outgoing Data packets.

Definition at line 86 of file face.hpp.

◆ nOutHopLimitZero

PacketCounter nfd::face::FaceCounters::nOutHopLimitZero

Count of outgoing Interests dropped due to HopLimit == 0 on non-local faces.

Definition at line 98 of file face.hpp.

◆ nOutInterests

const PacketCounter& nfd::face::FaceCounters::nOutInterests

Count of outgoing Interest packets.

Definition at line 83 of file face.hpp.

◆ nOutNacks

const PacketCounter& nfd::face::FaceCounters::nOutNacks

Count of outgoing Nack packets.

Definition at line 88 of file face.hpp.

◆ nOutPackets

const PacketCounter& nfd::face::FaceCounters::nOutPackets

Count of outgoing packets.

A 'packet' typically means a top-level TLV element.

This counter is incremented only when the transport is UP.

Definition at line 91 of file face.hpp.