-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpackage.json
More file actions
381 lines (381 loc) · 16.5 KB
/
package.json
File metadata and controls
381 lines (381 loc) · 16.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
{
"name": "vscode-flamegraph",
"displayName": "Flamegraph",
"description": "Py-spy and Memray Profiling in VS Code",
"icon": "assets/flame.png",
"license": "Apache-2.0",
"version": "0.6.3",
"publisher": "rafaelha",
"homepage": "https://github.com/rafaelha/vscode-flamegraph",
"repository": {
"type": "git",
"url": "https://github.com/rafaelha/vscode-flamegraph"
},
"bugs": {
"url": "https://github.com/rafaelha/vscode-flamegraph/issues"
},
"engines": {
"vscode": "^1.95.0"
},
"keywords": [
"profiler",
"py-spy",
"pyspy",
"memray",
"flame graph",
"profile",
"profiling",
"memory profiler",
"python",
"performance",
"performance analysis",
"speed",
"jupyter notebook",
"jupyter profiling"
],
"categories": [
"Visualization",
"Testing",
"Other"
],
"enableTelemetry": false,
"main": "./out/extension.js",
"activationEvents": [
"onCommand:flamegraph.loadProfile",
"onCommand:flamegraph.runProfiler"
],
"contributes": {
"commands": [
{
"command": "flamegraph.showFlamegraph",
"title": "Flamegraph: Show"
},
{
"command": "flamegraph.profileCell",
"title": "Flamegraph: Profile Cell",
"icon": "$(flame)"
},
{
"command": "flamegraph.profileNotebook",
"title": "Profile",
"icon": "$(flame)"
},
{
"command": "flamegraph.loadProfile",
"title": "Flamegraph: Load Profile"
},
{
"command": "flamegraph.toggleProfile",
"title": "Flamegraph: Toggle Inline Profile"
},
{
"command": "flamegraph.runProfiler",
"title": "Flamegraph: Profile file with py-spy",
"icon": "$(flame)"
},
{
"command": "flamegraph.runMemrayProfiler",
"title": "Flamegraph: Profile file with memray",
"icon": "$(flame)"
},
{
"command": "flamegraph.memoryProfileCell",
"title": "Flamegraph: Profile cell with memray",
"icon": "$(flame)"
},
{
"command": "flamegraph.memoryProfileNotebook",
"title": "Flamegraph: Profile notebook with memray",
"icon": "$(flame)"
},
{
"command": "flamegraph.attachProfiler",
"title": "Flamegraph: Attach py-spy to running process"
},
{
"command": "flamegraph.attachMemoryProfiler",
"title": "Flamegraph: Attach memray to running process"
},
{
"command": "flamegraph.runAllPytests",
"title": "Flamegraph: Profile all unit tests with pytest"
},
{
"command": "flamegraph.runPytestFile",
"title": "Flamegraph: Profile unit tests in file with pytest"
},
{
"command": "flamegraph.top",
"title": "Flamegraph: Show py-spy top"
},
{
"command": "flamegraph.memoryLive",
"title": "Flamegraph: Attach memray live view to running process"
}
],
"configuration": {
"title": "Flamegraph",
"properties": {
"flamegraph.syncInlineAnnotations": {
"type": "boolean",
"default": true,
"description": "Sync inline annotations with the flamegraph. Whenever a node in the flamegraph is clicked, the inline annotations will be updated to only reflect timing information for the visible flamegraph nodes.",
"scope": "resource"
},
"flamegraph.showFlamegraph": {
"type": "string",
"enum": [
"show",
"showAndFocus",
"onlyShowCodeAnnotations"
],
"default": "show",
"enumDescriptions": [
"Display the flamegraph in a new tab after profiling.",
"Display and bring the flamegraph tab to focus after profiling.",
"Only show the code annotations after profiling and do not open the flamegraph tab. The flamegraph panel can be manually opened by the 'Flamegraph: Show' command."
],
"description": "Controls how the flamegraph is displayed after profiling completes.",
"scope": "resource"
},
"flamegraph.py-spy.subprocesses": {
"type": "boolean",
"default": true,
"description": "Profile subprocesses of the original process. Note: On Windows and for some Python versions, this option must be enabled for the profiler to find the python process.",
"scope": "resource"
},
"flamegraph.py-spy.subprocessesAttach": {
"type": "boolean",
"default": true,
"description": "Profile subprocesses that are spawned by the process that py-spy is attached to. Note: On Windows and for some Python versions, this option must be enabled for the profiler to find the Python process.",
"scope": "resource"
},
"flamegraph.py-spy.native": {
"type": "boolean",
"default": false,
"description": "Profile native extensions. Note: This option can not be used with the nonblocking option and is not supported on MacOS and some Linux distributions.",
"scope": "resource"
},
"flamegraph.py-spy.nativeAttach": {
"type": "boolean",
"default": false,
"description": "Profile native extensions when attaching to a running process. Note: This option can not be used with the nonblocking option and is not supported on MacOS and some Linux distributions.",
"scope": "resource"
},
"flamegraph.py-spy.gil": {
"type": "boolean",
"default": false,
"description": "Only include traces that are holding on to the GIL (Global Interpreter Lock).",
"scope": "resource"
},
"flamegraph.py-spy.idle": {
"type": "boolean",
"default": false,
"description": "Include stack traces for idle threads.",
"scope": "resource"
},
"flamegraph.py-spy.nonblocking": {
"type": "boolean",
"default": false,
"description": "Don't pause the Python process when collecting samples. This will reduce the performance impact of sampling, but may lead to inaccurate results.",
"scope": "resource"
},
"flamegraph.py-spy.alwaysUseSudo": {
"type": "boolean",
"default": false,
"description": "Always use sudo when running py-spy commands. This is required for some Linux distributions.",
"scope": "resource"
},
"flamegraph.memray.alwaysUseSudo": {
"type": "boolean",
"default": false,
"description": "Always use sudo when running memray commands. This is required for some Linux distributions.",
"scope": "resource"
},
"flamegraph.memray.tracePythonAllocators": {
"type": "boolean",
"default": false,
"description": "Record allocations made by the pymalloc allocator.",
"scope": "resource"
},
"flamegraph.memray.native": {
"type": "boolean",
"default": false,
"description": "Track native (C/C++) stack frames as well as Python frames when profiling as script.",
"scope": "resource"
},
"flamegraph.memray.nativeAttach": {
"type": "boolean",
"default": false,
"description": "Track native (C/C++) stack frames as well as Python frames when attaching to a running process.",
"scope": "resource"
},
"flamegraph.memray.showMemoryLeaks": {
"type": "boolean",
"default": false,
"description": "Show memory leaks, instead of peak memory usage. Memory leaks are allocations that are not freed until the process exits or the profiler is stopped.",
"scope": "resource"
}
}
},
"taskDefinitions": [
{
"type": "flamegraph",
"properties": {
"mode": {
"type": "string",
"description": "The mode of the task (should be 'record' or 'top')",
"default": "record",
"enum": [
"record",
"top"
]
},
"file": {
"type": "string",
"description": "The file to profile (optional)"
},
"pid": {
"type": "string",
"description": "The process ID (PID) to attach to, if no file is provided (optional)"
},
"subprocesses": {
"type": "boolean",
"description": "Profile subprocesses (optional)",
"default": true
},
"native": {
"type": "boolean",
"description": "Use native profiling (optional)",
"default": false
},
"args": {
"type": "array",
"description": "The arguments to pass to the profiler (optional)",
"items": {
"type": "string"
}
},
"pythonPath": {
"type": "string",
"description": "The path to the Python interpreter. If not provided, the path will be retrieved from currently active environment selected in the VS Code Python extension."
},
"profilerPath": {
"type": "string",
"description": "The path to py-spy. If not provided, either the global py-spy installation will be used or the py-spy found in the currently active environment."
},
"sudo": {
"type": "boolean",
"description": "Whether to use sudo when running the profiler. This is required for macOS and some Linux distributions.",
"default": false
}
},
"when": "shellExecutionSupported"
}
],
"menus": {
"explorer/context": [
{
"when": "resourceExtname == .py",
"command": "flamegraph.runProfiler",
"group": "Python"
},
{
"when": "resourceExtname == .pyspy || resourceExtname == .memray",
"command": "flamegraph.loadProfile",
"group": "Python"
}
],
"editor/context": [
{
"command": "flamegraph.toggleProfile",
"group": "2_workspace",
"when": "editorLangId == python && !virtualWorkspace"
}
],
"editor/title/run": [
{
"command": "flamegraph.runProfiler",
"group": "navigation@2",
"when": "resourceLangId == python && !isInDiffEditor && !virtualWorkspace && shellExecutionSupported"
}
],
"notebook/cell/execute": [
{
"command": "flamegraph.profileCell",
"when": "notebookKernel =~ /^ms-toolsai.jupyter\\// && jupyter.ispythonnotebook && notebookCellType == code && isWorkspaceTrusted && resource not in jupyter.notebookeditor.debugDocuments || !notebookKernel && jupyter.ispythonnotebook && notebookCellType == code && isWorkspaceTrusted",
"group": "jupyterCellExecute@0"
}
],
"notebook/toolbar": [
{
"command": "flamegraph.profileNotebook",
"group": "navigation/execute@5",
"when": "notebookKernel =~ /^ms-toolsai.jupyter\\// && notebookType == 'jupyter-notebook' && isWorkspaceTrusted && jupyter.kernel.isjupyter"
}
],
"notebook/cell/title": [
{
"command": "flamegraph.profileCell",
"when": "notebookKernel =~ /^ms-toolsai.jupyter\\// && notebookType == jupyter-notebook && jupyter.ispythonnotebook && notebookCellType == code && isWorkspaceTrusted && resource not in jupyter.notebookeditor.runByLineDocuments || !notebookKernel && notebookType == jupyter-notebook && jupyter.ispythonnotebook && notebookCellType == code && isWorkspaceTrusted",
"group": "inline/cell@3"
}
]
}
},
"scripts": {
"install:all": "npm install && cd flamegraph-react && npm install",
"start:webview": "cd flamegraph-react && npm run start",
"build:webview": "cd flamegraph-react && npm run build",
"test:webview": "cd flamegraph-react && npm run test",
"vscode:prepublish": "cross-env NODE_ENV=production npm run compile:prod",
"compile:prod": "tsc -p ./",
"compile": "cross-env NODE_ENV=development tsc -p ./",
"test": "cross-env NODE_ENV=development mocha",
"test:performance": "cross-env NODE_ENV=development mocha './out/test/suite/performance.test.js'",
"watch": "tsc -watch -p ./",
"pretest": "npm run compile && npm run lint",
"lint": "eslint src --ext ts",
"lint:fix": "eslint src --ext ts --fix",
"format": "npx prettier --write .",
"ui-test": "extest setup-and-run './out/ui-test/*.test.js' --code_version max --code_settings settings.json --extensions_dir .test-extensions"
},
"devDependencies": {
"@types/chai": "^4.3.16",
"@types/glob": "^8.0.1",
"@types/mocha": "^10.0.8",
"@types/node": "^20.0.0",
"@types/vscode": "^1.95.0",
"@typescript-eslint/eslint-plugin": "^8.15.0",
"@typescript-eslint/parser": "^8.15.0",
"@vscode/test-cli": "^0.0.10",
"@vscode/test-electron": "^2.4.1",
"chai": "^6.0.1",
"cross-env": "^7.0.3",
"eslint": "^8.57.1",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-hooks": "^4.6.2",
"glob": "^11.0.0",
"mocha": "^10.8.2",
"prettier": "^3.3.3",
"ts-node": "^10.9.2",
"typescript": "^5.7.2",
"vscode-extension-tester": "^8.17.0",
"vscode-test": "^1.5.0"
},
"extensionDependencies": [
"ms-python.python",
"ms-toolsai.jupyter"
],
"dependencies": {
"@vscode/jupyter-extension": "^1.1.1",
"@vscode/python-extension": "^1.0.5",
"vscode-uri": "^3.1.0"
}
}