Skip to content

Commit b2b839b

Browse files
authored
Merge pull request #17 from zendive/next
- Worker telemetry - `constructor`, `terminate`, `onmessage`, `onerror`, `postMessage`, `addEventListener`, `removeEventListener`. - Worker instances are grouped by source code specifier. - Scheduler telemetry - `yield`, `postTask`. - Fix for async anonymous trace link. - Some minor UI changes. - Self time cell now has revolving modes, toggling between {latest} value and aggregated one, in the format of: {mean} ± {standard-deviation} {maximum}. - Added detection of cases when extension stops working due to extension update, while being used. Added two types of alerts that inform about the need to reload inspected tab or DevTools itself.
2 parents 0e1348f + a86a725 commit b2b839b

File tree

95 files changed

+2962
-662
lines changed

Some content is hidden

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

95 files changed

+2962
-662
lines changed

Makefile

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
.PHONY: clean install dev valid test prod serve_mirror
1+
.PHONY: clean install dev valid test test-dev prod mirror-dev mirror-serve
22
.DEFAULT_GOAL := dev
3-
DENO_DEV = NODE_ENV=development deno run --watch
4-
DENO_PROD = NODE_ENV=production deno run
5-
DENO_OPTIONS = --allow-env --allow-read --allow-run
6-
CHROME_ZIP="extension.chrome.zip"
7-
OUTPUT_DIR = ./public/
8-
BUILD_DIR = ./public/build/
9-
BUILD_SCRIPT = ./build.ts
3+
DENO_DEV := NODE_ENV=development deno run --watch
4+
DENO_PROD := NODE_ENV=production deno run
5+
DENO_OPTIONS := --allow-env --allow-read --allow-run
6+
VERSION != deno eval "\
7+
import m from './manifest.json' with {type:'json'};\
8+
console.log(m.version);\
9+
"
10+
CHROME_ZIP := "extension.chrome-$(VERSION).zip"
11+
OUTPUT_DIR := ./public/
12+
BUILD_DIR := ./public/build/
13+
BUILD_SCRIPT := ./build.ts
1014

1115
clean:
1216
rm -rf ./node_modules $(BUILD_DIR) $(CHROME_ZIP)
@@ -39,7 +43,12 @@ prod: test
3943

4044
tree -Dis $(BUILD_DIR) *.zip | grep -E "api|zip"
4145

42-
serve_mirror:
46+
mirror-dev:
47+
@echo "🎗 reminder to stop \"make dev\""
48+
rm -rf $(BUILD_DIR)
49+
$(DENO_DEV) $(DENO_OPTIONS) $(BUILD_SCRIPT) --mirror
50+
51+
mirror-serve:
4352
@echo "🎗 reminder to switch extension off"
4453
@echo "served at: http://localhost:5555/mirror.html"
4554
python3 -m http.server 5555 -d ./public/

README.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,21 @@ To assess Web Application implementation correctness and expedite issues discove
3131
- Measure callback's execution self-time.
3232
- Warn if it exceeds 4/5 (13.33ms) of 60 FPS hardcoded frame-rate (16.66ms).
3333

34-
- Count `requestAnimationFrame` calls per second (CPS).
34+
- Count calls per second (CPS) when applicable.
3535
- If requested recursively - it reflects animation FPS.
3636

37-
- Detect `eval` function usage in runtime, as well as `setTimeout` and `setInterval` when called with a `string` callback instead of a `function`. By default - `off`, cause the fact of wrapping it, excludes the access to local scope variables from the `eval` script, and as a result, may brake the application if it does need it.
37+
- Detect `eval` function usage in runtime, as well as `setTimeout` and `setInterval` when called with a `string` callback instead of a `function`.
38+
- By default - `off`, cause the fact of wrapping it, excludes the access to local scope variables from the `eval` script, and as a result, may break the application if it does depend on it.
39+
40+
- Monitor Worker's methods and event handlers metrics.
41+
- Warn if number of active workers exceeds number of available CPU cores.
42+
- keep in mind: extension API can't wrap `self.close()` in worker global context (only `terminate()` in top context)
43+
- Detect anomalies:
44+
- attempt to add already added listener with `addEventListener`.
45+
- attempt to remove unknown listener with `removeEventListener`.
46+
47+
- Monitor `scheduler.yield` and `scheduler.postTask`.
48+
- Calls, delay, priority, aborts, self-time metrics.
3849

3950
- Monitor mounted `video` and `audio` media elements in DOM.
4051
- Present control panel with basic media functions.
@@ -56,12 +67,25 @@ To assess Web Application implementation correctness and expedite issues discove
5667
- `cancelAnimationFrame`
5768
- `requestIdleCallback`
5869
- `cancelIdleCallback`
70+
- `Worker`
71+
- `constructor`
72+
- `terminate`
73+
- `onmessage`
74+
- `onerror`
75+
- `postMessage`
76+
- `addEventListener`
77+
- `removeEventListener`
78+
- `scheduler`
79+
- `postTask`
80+
- `yield`
5981

6082
</details>
6183
<details>
6284
<summary> <strong>Screenshots</strong> </summary>
6385

86+
![screenshot](./doc/screenshot-01.png)
6487
![screenshot](./doc/screenshot-02.png)
88+
![screenshot](./doc/screenshot-03.png)
6589
![screenshot](./doc/screenshot-04.png)
6690

6791
</details>
@@ -73,7 +97,7 @@ To assess Web Application implementation correctness and expedite issues discove
7397

7498
- OS: Linux
7599
- Node: 22.14.0 (LTS)
76-
- [Deno](https://docs.deno.com/runtime/getting_started/installation/) 2.3.5
100+
- [Deno](https://docs.deno.com/runtime/getting_started/installation/) 2.4.2
77101

78102
### Build instructions
79103

build.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import manifest from './manifest.json' with { type: 'json' };
55

66
const nodeEnv = Deno.env.get('NODE_ENV');
77
const isProd = nodeEnv === 'production';
8+
const isMirror = Deno.args.includes('--mirror');
89
const buildOptions: BuildOptions = {
910
plugins: [
1011
esbuildSvelte({
@@ -25,6 +26,9 @@ const buildOptions: BuildOptions = {
2526
__app_name__: `"browser-api-monitor@${manifest.version}"`,
2627
__app_version__: `"${manifest.version}"`,
2728
__home_page__: `"${manifest.homepage_url}"`,
29+
__release_page__:
30+
`"https://github.com/zendive/browser-api-monitor/releases"`,
31+
__mirror__: `${isMirror}`,
2832
},
2933
bundle: true,
3034
platform: 'browser',

deno.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@
3434
]
3535
},
3636
"imports": {
37-
"esbuild": "https://deno.land/x/[email protected]/mod.js",
38-
"@luca/esbuild-deno-loader": "jsr:@luca/[email protected]",
39-
"esbuild-svelte": "npm:[email protected]",
37+
"esbuild": "https://deno.land/x/[email protected]/mod.js",
38+
"esbuild-svelte": "npm:[email protected]",
4039
"svelte-preprocess": "npm:[email protected]",
4140

42-
"@std/expect": "jsr:@std/expect@^1.0.15",
43-
"@std/testing": "jsr:@std/testing@^1.0.11",
44-
"happy-dom": "npm:[email protected]"
41+
"@std/expect": "jsr:@std/expect@^1.0.16",
42+
"@std/testing": "jsr:@std/testing@^1.0.15",
43+
"happy-dom": "npm:[email protected]",
44+
"scheduler-polyfill": "npm:[email protected]"
4545
}
4646
}

0 commit comments

Comments
 (0)