Safe access of sequencer (#1625)

* log some NACKs

* split out NACK tracker

* remove debug

* debug

* Sequencer safety

* Clean up
This commit is contained in:
Raja Subramanian
2023-04-17 13:02:24 +05:30
committed by GitHub
parent d9cd07c4b1
commit 5b34d754e0
5 changed files with 57 additions and 32 deletions
+4 -2
View File
@@ -77,9 +77,11 @@ func (n *NackTracker) IsTriggered() bool {
func (n *NackTracker) ToString() string {
window := ""
if !n.windowStartTime.IsZero() {
window = fmt.Sprintf("t: %+v|%+v", n.windowStartTime, time.Since(n.windowStartTime))
now := time.Now()
elapsed := now.Sub(n.windowStartTime).Seconds()
window = fmt.Sprintf("t: %+v|%+v|%.2fs", n.windowStartTime.Format(time.UnixDate), now.Format(time.UnixDate), elapsed)
}
return fmt.Sprintf("n: %s, t: %s, p: %d, rn: %d, rn/p: %f", n.params.Name, window, n.packets, n.repeatedNacks, n.GetRatio())
return fmt.Sprintf("n: %s, t: %s, p: %d, rn: %d, rn/p: %.2f", n.params.Name, window, n.packets, n.repeatedNacks, n.GetRatio())
}
// ------------------------------------------------