33 bool advanceEOM =
false;
36 (
byteEvents_.front().byteOffset_ <= bytesWritten)) {
39 auto txn =
event.getTransaction();
41 switch (event.eventType_) {
43 txn->onEgressHeaderFirstByte();
46 txn->onEgressBodyFirstByte();
49 txn->onEgressBodyLastByte();
56 txn->onEgressTrackedByte();
59 latency =
event.getLatency();
66 VLOG(5) <<
" removing ByteEvent " << event;
69 event.listHook.unlink();
76 return self.use_count() == 1;
92 VLOG(5) <<
" adding last byte event for " << byteNo;
101 VLOG(5) <<
" adding tracked byte event for " << byteNo;
112 uint64_t offset = bytesScheduled + pingSize;
115 if (
i->byteOffset_ > bytesScheduled) {
116 VLOG(5) <<
"pushing back ByteEvent from " << *
i <<
" to " 117 <<
ByteEvent(
i->byteOffset_ + pingSize,
i->eventType_);
118 i->byteOffset_ += pingSize;
131 CHECK_GT(
i->byteOffset_, bytesScheduled);
void addFirstBodyByteEvent(uint64_t offset, HTTPTransaction *txn)
constexpr detail::Map< Move > move
virtual void addLastByteEvent(HTTPTransaction *txn, uint64_t byteNo) noexcept
requires E e noexcept(noexcept(s.error(std::move(e))))
void addPingByteEvent(size_t pingSize, TimePoint timestamp, uint64_t bytesScheduled)
virtual ~ByteEventTracker()
virtual void onLastByteEvent(HTTPTransaction *txn, uint64_t offset, bool eomTracked) noexcept=0
virtual bool processByteEvents(std::shared_ptr< ByteEventTracker > self, uint64_t bytesWritten)
virtual void onPingReplyLatency(int64_t latency) noexcept=0
virtual void eomEventProcessed()
SteadyClock::time_point TimePoint
virtual void addFirstHeaderByteEvent(uint64_t offset, HTTPTransaction *txn)
virtual void absorb(ByteEventTracker &&other)
virtual size_t drainByteEvents()
virtual void addTrackedByteEvent(HTTPTransaction *txn, uint64_t byteNo) noexcept
folly::IntrusiveList< ByteEvent,&ByteEvent::listHook > byteEvents_