Commit d33b0e6
committed
Measure live telemetry freshness at frame receipt instead of the producer clock
Pecan showed STOPPED on every data row whenever the car/ECU clock was skewed
from the viewing browser. getFrequency anchored its 2-second liveness window to
the browser's Date.now() while frames carry the car's absolute timestamps, so a
clock skew greater than the window dropped every frame outside it and reported 0
Hz even while data streamed.
Track each message buffer's wall-clock receipt time (lastReceivedAt) separately
from the producer timestamp, and anchor the live window to newest-sample
timestamp plus the time elapsed since it arrived. Steady skew now cancels out so
a streaming feed reads live, while the window still empties to 0 Hz once frames
genuinely stop. Replay path is unchanged. Adds regression tests for both cases.1 parent 7b0e2ea commit d33b0e6
2 files changed
Lines changed: 67 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
74 | 119 | | |
75 | 120 | | |
76 | 121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
60 | 64 | | |
61 | 65 | | |
62 | 66 | | |
| |||
551 | 555 | | |
552 | 556 | | |
553 | 557 | | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
554 | 561 | | |
555 | 562 | | |
556 | 563 | | |
| |||
597 | 604 | | |
598 | 605 | | |
599 | 606 | | |
| 607 | + | |
600 | 608 | | |
601 | 609 | | |
602 | 610 | | |
| |||
605 | 613 | | |
606 | 614 | | |
607 | 615 | | |
| 616 | + | |
608 | 617 | | |
609 | 618 | | |
610 | 619 | | |
| |||
644 | 653 | | |
645 | 654 | | |
646 | 655 | | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
647 | 659 | | |
648 | 660 | | |
649 | 661 | | |
| |||
684 | 696 | | |
685 | 697 | | |
686 | 698 | | |
| 699 | + | |
687 | 700 | | |
688 | 701 | | |
689 | 702 | | |
690 | 703 | | |
691 | 704 | | |
692 | 705 | | |
| 706 | + | |
693 | 707 | | |
694 | 708 | | |
695 | 709 | | |
| |||
928 | 942 | | |
929 | 943 | | |
930 | 944 | | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
931 | 951 | | |
932 | | - | |
933 | | - | |
| 952 | + | |
| 953 | + | |
934 | 954 | | |
935 | 955 | | |
936 | 956 | | |
| |||
0 commit comments