@reqray/waterfall 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -5
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,12 +1,42 @@
|
|
|
1
1
|
# @reqray/waterfall
|
|
2
2
|
|
|
3
|
-
The waterfall model, shared by every client that draws one: which
|
|
3
|
+
The waterfall model of Reqray, shared by every client that draws one: which
|
|
4
|
+
spans collapse into a run, where the uninstrumented time is, how deep each bar
|
|
5
|
+
sits. It decides structure and never draws.
|
|
4
6
|
|
|
5
|
-
Part of [Reqray](https://github.com/reqray/reqray) — a dev panel and request
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
Part of [Reqray](https://github.com/reqray/reqray) — a dev panel and request inspector for Node.js. It
|
|
8
|
+
instruments HTTP, SQL, outgoing calls and cache on its own, shows every
|
|
9
|
+
request as a waterfall, and finds N+1 down to the file and the line.
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
The web panel and [`@reqray/cli`](https://www.npmjs.com/package/@reqray/cli)
|
|
12
|
+
both build their waterfalls with it, which is why they agree. Install it to
|
|
13
|
+
draw a Reqray request somewhere else.
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @reqray/waterfall
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { buildWaterfall, uninstrumentedMs } from '@reqray/waterfall';
|
|
21
|
+
|
|
22
|
+
const bars = buildWaterfall(request); // spans, findings and durationMs of one request
|
|
23
|
+
console.log(`${uninstrumentedMs(bars)} ms no span accounts for`);
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
| | |
|
|
27
|
+
|---|---|
|
|
28
|
+
| `buildWaterfall(request)` | The bars, in drawing order: 150 identical queries folded into one, gaps made explicit |
|
|
29
|
+
| `findGaps(request)` | Stretches of the request no span covers |
|
|
30
|
+
| `uninstrumentedMs(bars)` | Their total |
|
|
31
|
+
| `parallelSpans(spans)` | Which spans overlapped in time |
|
|
32
|
+
| `depthOf(span, byId)` | How deep a span is nested |
|
|
33
|
+
|
|
34
|
+
Types come from [`@reqray/protocol`](https://www.npmjs.com/package/@reqray/protocol).
|
|
35
|
+
|
|
36
|
+
## More
|
|
37
|
+
|
|
38
|
+
Everything else — the detectors, security defaults, measured overhead and a
|
|
39
|
+
demo that runs with one command — is in the
|
|
10
40
|
[main README](https://github.com/reqray/reqray#readme).
|
|
11
41
|
|
|
12
42
|
## License
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reqray/waterfall",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "The waterfall model, shared by every client that draws one: which spans collapse, where the uninstrumented time is, how deep each bar sits.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"access": "public"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@reqray/protocol": "^0.1.
|
|
51
|
+
"@reqray/protocol": "^0.1.1"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@types/node": "^26.2.0",
|