34 : queueLimit_ (0), lowThresh_ (0), lowThreshPrecentage_ (lowThreshPrecentage), frontPktSize_(0)
37 limit( _limit, lowThreshPrecentage_);
39 namespace fty = console::factory;
42 .doc(
"set the RED queue size bytes and low threshold in percent"));
45 .doc(
"get the RED queue size in bytes and low threshold in percent"));
47 .doc(
"get the number of dropped packets since the last call."));
49 .doc(
"return the current RED queue size (usage) in bytes"));
50 consoleDir().
add(
"droppedTotal", fty::Variable( boost::cref(REDQueue::packetsDroppedTotal_))
51 .doc(
"Get the total number of dropped packets."));
55 prefix_ void senf::emu::REDQueue::v_clear()
58 packetsDroppedLast_ = 0;
59 packetsDroppedTotal_ = 0;
60 while (!queue_.empty())
68 if (lowThreshPrecentage > 100)
69 lowThreshPrecentage = 100;
72 if (
bytes > 0x7fffffff)
76 lowThreshPrecentage_ = lowThreshPrecentage;
78 lowThresh_ = (queueLimit_ * lowThreshPrecentage_) / 100;
86 return std::make_pair(queueLimit_, lowThreshPrecentage_);
92 return packetsDroppedTotal_ - packetsDroppedLast_;
97 packetsDroppedLast_ = packetsDroppedTotal_;
std::pair< std::uint32_t, std::uint8_t > limit_t
#define SENF_MEMBINDFNP(ret, cls, fn, args)
std::uint32_t dropped() const
REDQueue(std::uint32_t _limit=16384, std::uint8_t lowThreshPrecentage=25)
PacketParserBase::size_type bytes(Parser const &p)
std::unique_ptr< QueueingAlgorithm > ptr
NodeType & add(std::string const &name, boost::shared_ptr< NodeType > node)
console::DirectoryNode & consoleDir()
static ppi::QueueingAlgorithm::ptr create()