Commit 3ec7b80
committed
perf(Sky): Batch performance marks in PostHogBridge to prevent rate limiting
Refactor PostHogBridge.ts to collect performance marks into a buffer and flush as a single event every 2 seconds, instead of sending individual events for each mark. This prevents PostHog rate limiting during editor boot sequences with many telemetry marks.
Changes:
- Add MarkBuffer array and FlushMarks function to batch marks
- Send "land:boot_marks" event with mark array instead of individual captures
- Add visibilitychange listener to flush remaining marks on page hide
- Errors continue to be sent immediately (no batching)
- Add "blob:" to connect-src CSP in index.astro for blob URL support in Electron webview1 parent 41a6fe6 commit 3ec7b80
2 files changed
Lines changed: 48 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
70 | 96 | | |
71 | 97 | | |
72 | 98 | | |
| |||
77 | 103 | | |
78 | 104 | | |
79 | 105 | | |
80 | | - | |
| 106 | + | |
81 | 107 | | |
82 | 108 | | |
83 | 109 | | |
84 | 110 | | |
85 | 111 | | |
86 | 112 | | |
87 | 113 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
94 | 121 | | |
95 | 122 | | |
96 | 123 | | |
97 | | - | |
| 124 | + | |
98 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
99 | 130 | | |
100 | 131 | | |
101 | 132 | | |
102 | 133 | | |
103 | 134 | | |
104 | 135 | | |
105 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
106 | 144 | | |
107 | 145 | | |
108 | 146 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| 110 | + | |
110 | 111 | | |
111 | 112 | | |
112 | 113 | | |
| |||
0 commit comments