|
| | EventBuilder (unsigned timeout, const unsigned &verbose) |
| | Set the event timeout to timeout milliseconds (0 means effectively no timeout) and keep verbose by reference; prints the timeout to stderr.
|
| |
| virtual | ~EventBuilder () |
| | Does nothing; empty body.
|
| |
| virtual void | flush () |
| | Hook called by expired() when nothing is pending; the default does nothing.
|
| |
| virtual void | fixup (EbEvent *, unsigned srcId)=0 |
| | Pure virtual: called once for each missing contributor srcId of an event that is being forced out (timed out or flushed by a newer complete event).
|
| |
| virtual void | process (EbEvent *)=0 |
| | Pure virtual: handle a completed or fixed-up event; called in pulse ID order just before the event is freed.
|
| |
| virtual uint64_t | contract (const Pds::EbDgram *) const =0 |
| | Pure virtual: return the bit list of contributors expected for the event that this contribution starts.
|
| |
| void | expired () |
| | Periodic timeout handler.
|
| |
| void | process (const Pds::EbDgram *dgrams, const size_t bufSize, unsigned imm, const void *const end) |
| | Insert a batch of contributions starting at dgrams (entries bufSize bytes apart, ending at the EOL entry or after the maximum number of entries) into their events, with immediate data imm incremented per entry; end is only used to report a missing EOL.
|
| |
| void | resetCounters () |
| | Zero the pool counters, the timeout and fixup counts, the missing bit list, the occupancy counts, the event age, the processing time and the arrival times.
|
| |
| void | clear () |
| | Delete all pending events, discard the now-empty epochs, reset the counters and clear the epoch and event lookup tables.
|
| |
| void | dump (unsigned detail) const |
| | Print the pending epochs (and their events, depending on detail) and the state of both object pools to stderr.
|
| |
| const uint64_t | epochAllocCnt () const |
| | Return the number of allocations from the epoch pool (0 before initialize()).
|
| |
| const uint64_t | epochFreeCnt () const |
| | Return the number of frees to the epoch pool (0 before initialize()).
|
| |
| const int64_t | epochOccCnt () const |
| | Return the number of epochs in use (allocations minus frees), also caching it.
|
| |
| const uint64_t | eventAllocCnt () const |
| | Return the number of allocations from the event pool (0 before initialize()).
|
| |
| const uint64_t | eventFreeCnt () const |
| | Return the number of frees to the event pool (0 before initialize()).
|
| |
| const int64_t | eventOccCnt () const |
| | Return the number of events in use (allocations minus frees), also caching it.
|
| |
| const uint64_t | eventPoolDepth () const |
| | Return the number of objects in the event pool (0 before initialize()); returned by value.
|
| |
| const uint64_t | timeoutCnt () const |
| | Return the number of incomplete events forced out because they were older than the timeout.
|
| |
| const uint64_t | fixupCnt () const |
| | Return the number of incomplete events forced out before reaching the timeout.
|
| |
| const uint64_t | missing () const |
| | Return the bit list of contributors still missing from the most recently fixed-up event.
|
| |
| const int64_t | eventAge () const |
| | Return the most recently recorded event age in nanoseconds (updated while flushing and when an event is retired).
|
| |
| const int64_t | ebTime () const |
| | Return the time spent in the most recent process(dgrams, ...) call, in nanoseconds.
|
| |
| const int64_t | arrTime (unsigned src) const |
| | Return, for contributor src, the time in nanoseconds from the creation of the last event in its most recent batch to the start of processing that batch; 0 if src is out of range.
|
| |
Abstract event builder.
Contributions with the same pulse ID are collected into an EbEvent (events are grouped into epochs of a fixed duration), and events are passed to process(EbEvent*) in pulse ID order once their contract is met or they are forced out. Subclasses supply fixup(), process(EbEvent*) and contract().
| void Pds::Eb::EventBuilder::process |
( |
const Pds::EbDgram * |
dgrams, |
|
|
const size_t |
bufSize, |
|
|
unsigned |
imm, |
|
|
const void *const |
end |
|
) |
| |
Insert a batch of contributions starting at dgrams (entries bufSize bytes apart, ending at the EOL entry or after the maximum number of entries) into their events, with immediate data imm incremented per entry; end is only used to report a missing EOL.
Completed events, and older events subject to the timeout rules, are then delivered; if none completed, a flush is tried at most every 100 ms. Also updates the arrival-time and processing-time metrics.