feat: a repaired hole keeps a fainter band, so a report is not a false accusation
This commit is contained in:
1 parent
4666b807fc
commit
3859d2ca79
5 files changed
+48
-11
No files matched your search
@@ -183,6 +183,22 @@ struct Hole {
|
||||
u64 tick_begin = 0; ///< absolute base tick of the hole's first raw sample
|
||||
std::uint32_t counter_first = 0; ///< counter of the first missing packet
|
||||
std::uint32_t packets = 0; ///< packets the hole is worth
|
||||
/// How many of those packets have since arrived late and been written in. The band's two tints
|
||||
/// are this field against `packets`: a hole still missing data is shaded solidly and a fully
|
||||
/// repaired one faintly, so a reader can tell "there is no data here" from "there was none when
|
||||
/// this window was first drawn".
|
||||
///
|
||||
/// Counted in *packets* and not in slots, because a packet is the unit the reservation was made
|
||||
/// in: the hole is worth exactly `packets` of them, each late arrival delivers exactly one, and
|
||||
/// the client refuses a duplicate -- so this count is exact. A slot count would not be: the
|
||||
/// channels have different strides, so "how many slots did this hole want" has one answer per
|
||||
/// channel and the repaired test would have to pick one.
|
||||
std::uint32_t filled_packets = 0;
|
||||
|
||||
/// Every packet this hole was reserved for has arrived. A hole worth no packets is never
|
||||
/// repaired -- there is nothing for a late packet to deliver -- which keeps a degenerate
|
||||
/// reservation shaded rather than silently downgraded.
|
||||
bool repaired() const noexcept { return packets > 0 && filled_packets >= packets; }
|
||||
};
|
||||
|
||||
/// Live connection and counter state, readable from the UI thread.
|
||||
@@ -342,6 +358,10 @@ class ScopeModel {
|
||||
static constexpr std::size_t kMaxHoles = 64;
|
||||
void note_hole(const Hole& h);
|
||||
const std::vector<Hole>& holes() const noexcept { return holes_; }
|
||||
/// The producer's view of the same table. `Acquisition::backfill_from()` marks a hole's packet
|
||||
/// filled as it repairs it, and that mark is what the band's fainter tint reads. Caller holds
|
||||
/// `mutex()` -- the same requirement `note_hole()` above states, and the producer already does.
|
||||
std::vector<Hole>& holes() noexcept { return holes_; }
|
||||
/// Drops holes whose time-ring slots the ring has already discarded.
|
||||
void forget_holes_before(u64 slot);
|
||||
|
||||
|
||||
Reference in new issue
Block a user