proxygen
|
#include <ByteEventTracker.h>
Classes | |
class | Callback |
Public Member Functions | |
virtual | ~ByteEventTracker () |
ByteEventTracker (Callback *callback) | |
virtual void | absorb (ByteEventTracker &&other) |
void | setCallback (Callback *callback) |
virtual size_t | drainByteEvents () |
virtual bool | processByteEvents (std::shared_ptr< ByteEventTracker > self, uint64_t bytesWritten) |
void | addPingByteEvent (size_t pingSize, TimePoint timestamp, uint64_t bytesScheduled) |
void | addFirstBodyByteEvent (uint64_t offset, HTTPTransaction *txn) |
virtual void | addFirstHeaderByteEvent (uint64_t offset, HTTPTransaction *txn) |
virtual void | addLastByteEvent (HTTPTransaction *txn, uint64_t byteNo) noexcept |
virtual void | addTrackedByteEvent (HTTPTransaction *txn, uint64_t byteNo) noexcept |
virtual void | addAckByteEvent (uint64_t, HTTPTransaction *) |
virtual uint64_t | preSend (bool *, bool *, uint64_t) |
virtual void | setTTLBAStats (TTLBAStats *) |
Protected Member Functions | |
virtual void | eomEventProcessed () |
Protected Attributes | |
folly::IntrusiveList< ByteEvent,&ByteEvent::listHook > | byteEvents_ |
Callback * | callback_ |
ByteEventTracker can be used to fire application callbacks when a given byte of a transport stream has been processed. The primary usage is to fire the callbacks when the byte is accepted by the transport, not when the byte has been written on the wire, or acknowledged.
Subclasses may implement handling of acknowledgement timing.
Definition at line 29 of file ByteEventTracker.h.
|
virtual |
Definition at line 20 of file ByteEventTracker.cpp.
References drainByteEvents().
Referenced by proxygen::ByteEventTracker::Callback::~Callback().
|
inlineexplicit |
|
virtual |
Assumes the byte events of another ByteEventTracker that this object is replacing.
Definition at line 24 of file ByteEventTracker.cpp.
References byteEvents_, and folly::gen::move.
Referenced by ByteEventTracker().
|
inlinevirtual |
The base ByteEventTracker cannot track acks.
Definition at line 81 of file ByteEventTracker.h.
void proxygen::ByteEventTracker::addFirstBodyByteEvent | ( | uint64_t | offset, |
HTTPTransaction * | txn | ||
) |
Definition at line 136 of file ByteEventTracker.cpp.
References byteEvents_, and proxygen::ByteEvent::FIRST_BYTE.
Referenced by proxygen::MockByteEventTracker::MockByteEventTracker(), and setCallback().
|
virtual |
Definition at line 144 of file ByteEventTracker.cpp.
References byteEvents_, and proxygen::ByteEvent::FIRST_HEADER_BYTE.
Referenced by proxygen::MockByteEventTracker::MockByteEventTracker(), and setCallback().
|
virtualnoexcept |
Definition at line 89 of file ByteEventTracker.cpp.
References byteEvents_, and proxygen::ByteEvent::LAST_BYTE.
Referenced by proxygen::HTTPSessionBase::handleLastByteEvents(), proxygen::MockByteEventTracker::MockByteEventTracker(), and setCallback().
void proxygen::ByteEventTracker::addPingByteEvent | ( | size_t | pingSize, |
TimePoint | timestamp, | ||
uint64_t | bytesScheduled | ||
) |
The following methods add byte events for tracking
Definition at line 107 of file ByteEventTracker.cpp.
References byteEvents_, i, and uint64_t.
Referenced by proxygen::MockByteEventTracker::MockByteEventTracker(), and setCallback().
|
virtualnoexcept |
Definition at line 98 of file ByteEventTracker.cpp.
References byteEvents_, and proxygen::ByteEvent::TRACKED_BYTE.
Referenced by proxygen::MockByteEventTracker::MockByteEventTracker(), and setCallback().
|
virtual |
drainByteEvents should be called to clear out any pending events holding transactions when processByteEvents will no longer be called
Definition at line 79 of file ByteEventTracker.cpp.
References byteEvents_.
Referenced by proxygen::MockByteEventTracker::MockByteEventTracker(), setCallback(), and ~ByteEventTracker().
|
inlineprotectedvirtual |
HTTPSession uses preSend to truncate writes on an eom boundary. In Ack-tracking ByteEventTracker's, this should exmaine pending byte events and return the number of bytes until the next last byte event, or 0 if none are pending. If non-zero is returned then eom may be set to indicate ack tracking is requested.
Definition at line 91 of file ByteEventTracker.h.
Referenced by proxygen::MockByteEventTracker::MockByteEventTracker().
|
virtual |
processByteEvents is called whenever the transport has accepted more bytes. bytesWritten is the number of bytes written to the transport over its lifetime.
Definition at line 31 of file ByteEventTracker.cpp.
References byteEvents_, callback_, eomEventProcessed(), proxygen::ByteEvent::FIRST_BYTE, proxygen::ByteEvent::FIRST_HEADER_BYTE, int64_t, proxygen::ByteEvent::LAST_BYTE, proxygen::ByteEventTracker::Callback::onLastByteEvent(), proxygen::ByteEventTracker::Callback::onPingReplyLatency(), proxygen::ByteEvent::PING_REPLY_SENT, and proxygen::ByteEvent::TRACKED_BYTE.
Referenced by proxygen::MockByteEventTracker::MockByteEventTracker(), and setCallback().
|
inline |
Definition at line 48 of file ByteEventTracker.h.
References addFirstBodyByteEvent(), addFirstHeaderByteEvent(), addLastByteEvent(), addPingByteEvent(), addTrackedByteEvent(), callback_, drainByteEvents(), folly::pushmi::__adl::noexcept(), processByteEvents(), and uint64_t.
|
inlinevirtual |
Definition at line 96 of file ByteEventTracker.h.
|
protected |
Definition at line 100 of file ByteEventTracker.h.
Referenced by absorb(), addFirstBodyByteEvent(), addFirstHeaderByteEvent(), addLastByteEvent(), addPingByteEvent(), addTrackedByteEvent(), drainByteEvents(), and processByteEvents().
|
protected |
Definition at line 104 of file ByteEventTracker.h.
Referenced by processByteEvents(), and setCallback().