Skip to content

Commit 16492c2

Browse files
committed
merge in upstream
2 parents 0cc31e3 + 84d28f9 commit 16492c2

File tree

121 files changed

+4655
-1555
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+4655
-1555
lines changed

.github/workflows/jscpd.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"pattern": "packages/**/*.ts",
3+
"ignore": ["**node_modules**", "**dist**"],
4+
"gitignore": true,
5+
"threshold": 1.34,
6+
"minLines": 15
7+
}

.github/workflows/node.js.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,24 @@ jobs:
5555
- run: npm run testCompile
5656
- run: npm run lint
5757

58+
jscpd:
59+
needs: lint-commits
60+
runs-on: ubuntu-latest
61+
strategy:
62+
matrix:
63+
node-version: [18.x]
64+
env:
65+
NODE_OPTIONS: '--max-old-space-size=8192'
66+
steps:
67+
- uses: actions/checkout@v4
68+
- name: Use Node.js ${{ matrix.node-version }}
69+
uses: actions/setup-node@v4
70+
with:
71+
node-version: ${{ matrix.node-version }}
72+
- run: npm install jscpd
73+
- name: Run jscpd
74+
run: npx jscpd --config "$GITHUB_WORKSPACE/.github/workflows/jscpd.json"
75+
5876
macos:
5977
needs: lint-commits
6078
name: test macOS

docs/telemetry-perf.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,3 +258,70 @@ How long it took from when the user stopped pressing a key to when they were sho
258258
rHandler->>User: add to already shown results
259259
end
260260
```
261+
262+
## Crash Monitoring
263+
264+
We make an attempt to gather information regarding when the IDE crashes, then report it to telemetry. This is the diagram of the steps that take place.
265+
266+
### Sequence Diagram
267+
268+
> Keep in mind that the entire sequence below is duplicated for each instance of our extension.
269+
> They all work together to "crash check" on behalf of the other crashed extension instance.
270+
271+
`Crash Service`: The high level "service" that starts the heartbeats and crash checks
272+
273+
`Heartbeat`: Sends heartbeats which signal that the extension is still running and has not crashed
274+
275+
`Crash Checker`: Observes the heartbeats, reporting a telemetry event if a crash is detected
276+
277+
`File System State`: The user's file system where we store the heartbeat files from each extension instance
278+
279+
```mermaid
280+
%%{init: {'theme':'default'}}%%
281+
sequenceDiagram
282+
autonumber
283+
284+
participant VSC as VS Code
285+
participant Service as Crash Service
286+
participant Checker as Crash Checker
287+
participant Heartbeat as Heartbeat
288+
participant State as File System State
289+
participant Telemetry as Telemetry
290+
291+
rect rgb(121, 210, 121)
292+
alt Extension Startup
293+
VSC ->> Service: activate() - Start Service
294+
295+
Service ->> Heartbeat: Start Heartbeats
296+
Heartbeat ->> State: Send Initial Heartbeat <br/> (in a folder add a unique file w/ timestamp)
297+
rect rgb(64, 191, 64)
298+
par every N minutes
299+
Heartbeat ->> State: Send Heartbeat <br/> (overwrite the unique file w/ new timestamp)
300+
end
301+
end
302+
303+
Service ->> Checker: Start Crash Checking
304+
rect rgb(64, 191, 64)
305+
par every N*2 minutes
306+
Checker ->> Checker: If computer went to sleep, skip this iteration (gives time for a heartbeat)
307+
Checker ->> State: Request all heartbeat timestamps (readdir all heartbeat files)
308+
State ->> Checker: Receive all heartbeat timestamps
309+
loop for each crashed extension (it's timestamp >= N*2 minutes)
310+
Checker ->> State: Delete heartbeat file
311+
Checker ->> Telemetry: Send metric representing a crash: session_end
312+
end
313+
end
314+
end
315+
end
316+
end
317+
318+
rect rgb(255, 128, 128)
319+
alt Graceful Shutdown
320+
VSC ->> Service: deactivate() - Stop Service
321+
Service ->> Checker: Stop
322+
Service ->> Heartbeat: Stop
323+
Heartbeat ->> State: Delete timestamp file <br/> (This is missed when a crash happens)
324+
end
325+
end
326+
327+
```

0 commit comments

Comments
 (0)