@reqray/protocol 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/README.md +13 -2
- package/dist/index.cjs +19 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1308 -0
- package/dist/index.d.ts +1308 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -0
- package/package.json +56 -3
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,1308 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A recorded request, as it travels over the panel API.
|
|
3
|
+
*
|
|
4
|
+
* This package is the single declaration of the wire contract: `@reqray/core`
|
|
5
|
+
* imports these types and re-exports them, so the server and every client
|
|
6
|
+
* describe the same JSON rather than two hopeful approximations of it.
|
|
7
|
+
*
|
|
8
|
+
* There is no runtime code here, and there never will be — a client that
|
|
9
|
+
* speaks the protocol should not have to install the instrumentation that
|
|
10
|
+
* produces it.
|
|
11
|
+
*/
|
|
12
|
+
/** Span kind. Drives the bar colour in the waterfall. */
|
|
13
|
+
type SpanKind = 'middleware' | 'handler' | 'db' | 'http' | 'cache';
|
|
14
|
+
/**
|
|
15
|
+
* The spans a framework adapter opens itself, as opposed to the ones an
|
|
16
|
+
* instrumentation records around somebody else's call.
|
|
17
|
+
*/
|
|
18
|
+
type LabelSpanKind = Extract<SpanKind, 'middleware' | 'handler'>;
|
|
19
|
+
/** What a cache call does. */
|
|
20
|
+
type CacheOperation = 'get' | 'set' | 'del' | 'other';
|
|
21
|
+
/** Place in user code a span came from. Always inside the project. */
|
|
22
|
+
interface Callsite {
|
|
23
|
+
/** Absolute file path. */
|
|
24
|
+
readonly file: string;
|
|
25
|
+
/** Path relative to the project root — what a client shows. */
|
|
26
|
+
readonly relative: string;
|
|
27
|
+
readonly line: number;
|
|
28
|
+
readonly column: number;
|
|
29
|
+
}
|
|
30
|
+
/** Error attached to a span or to the request as a whole. */
|
|
31
|
+
interface SpanError {
|
|
32
|
+
readonly name: string;
|
|
33
|
+
readonly message: string;
|
|
34
|
+
readonly stack: string | null;
|
|
35
|
+
}
|
|
36
|
+
interface SpanCommon {
|
|
37
|
+
/** Sequence number within the request, starting at 1. */
|
|
38
|
+
readonly id: number;
|
|
39
|
+
/** Span this one ran inside of, or `null` for roots. */
|
|
40
|
+
readonly parentId: number | null;
|
|
41
|
+
/** Offset from the request start, ms. */
|
|
42
|
+
readonly startedAt: number;
|
|
43
|
+
/** Duration, ms. */
|
|
44
|
+
readonly duration: number;
|
|
45
|
+
/**
|
|
46
|
+
* Time spent in this span's own code, ms — its duration minus the stretch
|
|
47
|
+
* its children occupied, counting concurrent children once.
|
|
48
|
+
*
|
|
49
|
+
* The number to rank a waterfall by. Ranking by duration always returns the
|
|
50
|
+
* same useless answer: the handler at the top, because it contains
|
|
51
|
+
* everything and did nothing itself.
|
|
52
|
+
*
|
|
53
|
+
* Computed when the request finishes: a span does not know its children
|
|
54
|
+
* while it is still running.
|
|
55
|
+
*/
|
|
56
|
+
readonly selfMs: number;
|
|
57
|
+
readonly callsite: Callsite | null;
|
|
58
|
+
readonly error: SpanError | null;
|
|
59
|
+
}
|
|
60
|
+
/** Middleware span — the work before and after the handler. */
|
|
61
|
+
interface MiddlewareSpan extends SpanCommon {
|
|
62
|
+
readonly kind: 'middleware';
|
|
63
|
+
readonly label: string;
|
|
64
|
+
}
|
|
65
|
+
/** Route handler span. Parent of SQL, HTTP and cache spans. */
|
|
66
|
+
interface HandlerSpan extends SpanCommon {
|
|
67
|
+
readonly kind: 'handler';
|
|
68
|
+
readonly label: string;
|
|
69
|
+
}
|
|
70
|
+
/** Database query span. */
|
|
71
|
+
interface DbSpan extends SpanCommon {
|
|
72
|
+
readonly kind: 'db';
|
|
73
|
+
readonly sql: string;
|
|
74
|
+
/** Normalized SQL fingerprint — repeats are grouped by it. */
|
|
75
|
+
readonly fingerprint: string;
|
|
76
|
+
readonly rowCount: number | null;
|
|
77
|
+
/** Who recorded the span: `pg`, `prisma`, `mysql2`. */
|
|
78
|
+
readonly source: string | null;
|
|
79
|
+
/** Registry id of the pool or client that ran the query. */
|
|
80
|
+
readonly clientId: number | null;
|
|
81
|
+
/**
|
|
82
|
+
* Registry id of the physical connection the query ran on.
|
|
83
|
+
*
|
|
84
|
+
* Different from {@link DbSpan.clientId}, which names whatever EXPLAIN
|
|
85
|
+
* should later be sent to — for a pooled query that is the pool. This is
|
|
86
|
+
* the connection itself, and it is what turns `BEGIN` … `COMMIT` into a
|
|
87
|
+
* transaction: everything on one connection between them was inside it.
|
|
88
|
+
*/
|
|
89
|
+
readonly connectionId: number | null;
|
|
90
|
+
/**
|
|
91
|
+
* Time spent waiting for a free connection before the query ran, ms.
|
|
92
|
+
*
|
|
93
|
+
* `null` when nothing measured it — a driver without pool instrumentation,
|
|
94
|
+
* or a wait too short to be worth a number. Recorded separately from
|
|
95
|
+
* `duration` because they are different problems: a query that waited is
|
|
96
|
+
* fixed by the pool, a query that ran long is fixed by the query.
|
|
97
|
+
*/
|
|
98
|
+
readonly waitMs: number | null;
|
|
99
|
+
/** Parameter values, only when the application collects them. */
|
|
100
|
+
readonly values: readonly string[] | null;
|
|
101
|
+
}
|
|
102
|
+
/** Outgoing HTTP call span. */
|
|
103
|
+
interface HttpSpan extends SpanCommon {
|
|
104
|
+
readonly kind: 'http';
|
|
105
|
+
readonly method: string;
|
|
106
|
+
readonly url: string;
|
|
107
|
+
readonly statusCode: number | null;
|
|
108
|
+
}
|
|
109
|
+
/** Cache operation span. */
|
|
110
|
+
interface CacheSpan extends SpanCommon {
|
|
111
|
+
readonly kind: 'cache';
|
|
112
|
+
readonly operation: CacheOperation;
|
|
113
|
+
/** Command as the driver sent it, uppercase. `null` when unknown. */
|
|
114
|
+
readonly command: string | null;
|
|
115
|
+
/** What identifies the value: the key, plus what selects inside it. */
|
|
116
|
+
readonly key: string;
|
|
117
|
+
readonly hit: boolean | null;
|
|
118
|
+
}
|
|
119
|
+
/** A unit of work inside a request. */
|
|
120
|
+
type Span = MiddlewareSpan | HandlerSpan | DbSpan | HttpSpan | CacheSpan;
|
|
121
|
+
/** Log line bound to a request. */
|
|
122
|
+
interface LogEntry {
|
|
123
|
+
/** Offset from the request start, ms. */
|
|
124
|
+
readonly at: number;
|
|
125
|
+
readonly level: 'debug' | 'info' | 'warn' | 'error';
|
|
126
|
+
readonly message: string;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* What a request cost the process, as distinct from how long it took.
|
|
130
|
+
*
|
|
131
|
+
* The two come apart constantly: a request waiting 800 ms on a database is
|
|
132
|
+
* cheap, one spending 80 ms hashing a password is expensive, and a list
|
|
133
|
+
* ordered by duration puts them the wrong way round. Measured at the edges of
|
|
134
|
+
* the request, so it is always present rather than sampled.
|
|
135
|
+
*/
|
|
136
|
+
interface RequestCost {
|
|
137
|
+
/** Processor time in the request's window, user and system, ms. */
|
|
138
|
+
readonly cpuMs: number;
|
|
139
|
+
/**
|
|
140
|
+
* That time as a share of the wall clock. `1` is a request that spent its
|
|
141
|
+
* whole life on a processor, and above `1` is one that had more than one
|
|
142
|
+
* thread working for it — the libuv pool, or a worker.
|
|
143
|
+
*/
|
|
144
|
+
readonly cpuShare: number;
|
|
145
|
+
/** Time the garbage collector took inside the window, ms. */
|
|
146
|
+
readonly gcMs: number;
|
|
147
|
+
/** Collections inside the window. */
|
|
148
|
+
readonly collections: number;
|
|
149
|
+
/**
|
|
150
|
+
* Other requests that shared the window.
|
|
151
|
+
*
|
|
152
|
+
* `cpuMs` measures the process, not the request, so this is the number that
|
|
153
|
+
* says how far to trust it: at zero the window was this request's alone;
|
|
154
|
+
* above it the figure is shared, and a client must say so rather than
|
|
155
|
+
* dividing by a guess.
|
|
156
|
+
*/
|
|
157
|
+
readonly overlap: number;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* One place in the code, with how much of a stretch it held.
|
|
161
|
+
*
|
|
162
|
+
* From the sampling profiler, so it is a statistical claim rather than a
|
|
163
|
+
* measurement of that function: `share` is the fraction of samples in the
|
|
164
|
+
* window whose stack passed through here.
|
|
165
|
+
*/
|
|
166
|
+
interface HotFrame {
|
|
167
|
+
/** The function's name, or `(anonymous)`. */
|
|
168
|
+
readonly functionName: string;
|
|
169
|
+
/** Path relative to the project root. */
|
|
170
|
+
readonly relative: string;
|
|
171
|
+
readonly line: number;
|
|
172
|
+
/**
|
|
173
|
+
* What the frame was calling, or `null`.
|
|
174
|
+
*
|
|
175
|
+
* V8 reports where a function is defined, never the line running, so the
|
|
176
|
+
* address stops at the function. The callee recovers the rest: the frame
|
|
177
|
+
* says where to look, and this says what to look for once there —
|
|
178
|
+
* `pbkdf2Sync`, `processChunkSync`, `parse`.
|
|
179
|
+
*/
|
|
180
|
+
readonly inside: string | null;
|
|
181
|
+
readonly samples: number;
|
|
182
|
+
/** Share of the window's running samples, 0..1. */
|
|
183
|
+
readonly share: number;
|
|
184
|
+
}
|
|
185
|
+
/** How serious a finding is. */
|
|
186
|
+
type FindingSeverity = 'info' | 'warn' | 'critical';
|
|
187
|
+
/** Evidence for the N+1 detector. */
|
|
188
|
+
interface NPlusOneEvidence {
|
|
189
|
+
readonly kind: 'n_plus_one';
|
|
190
|
+
/** How many times the same fingerprint ran. */
|
|
191
|
+
readonly repeats: number;
|
|
192
|
+
readonly fingerprint: string;
|
|
193
|
+
/** One query from the group, shown as a sample. */
|
|
194
|
+
readonly sample: string;
|
|
195
|
+
/** Total time of all repeats, ms. */
|
|
196
|
+
readonly totalMs: number;
|
|
197
|
+
readonly spanIds: readonly number[];
|
|
198
|
+
}
|
|
199
|
+
/** Evidence for the sequential-HTTP detector. */
|
|
200
|
+
interface SequentialHttpEvidence {
|
|
201
|
+
readonly kind: 'sequential_http';
|
|
202
|
+
readonly repeats: number;
|
|
203
|
+
/** Normalized call shape: `GET api.example.com/users/:id`. */
|
|
204
|
+
readonly fingerprint: string;
|
|
205
|
+
readonly sample: string;
|
|
206
|
+
readonly totalMs: number;
|
|
207
|
+
readonly spanIds: readonly number[];
|
|
208
|
+
}
|
|
209
|
+
/** Evidence for the duplicate-work detectors, HTTP and cache alike. */
|
|
210
|
+
interface DuplicateEvidence {
|
|
211
|
+
readonly kind: 'duplicate';
|
|
212
|
+
readonly repeats: number;
|
|
213
|
+
/** What made them identical: the URL, or the cache key. */
|
|
214
|
+
readonly fingerprint: string;
|
|
215
|
+
readonly sample: string;
|
|
216
|
+
readonly totalMs: number;
|
|
217
|
+
readonly spanIds: readonly number[];
|
|
218
|
+
}
|
|
219
|
+
/** Evidence for the heavy-response detector: what came back, and from where. */
|
|
220
|
+
interface HeavyResponseEvidence {
|
|
221
|
+
readonly kind: 'heavy_response';
|
|
222
|
+
/** Bytes sent to the client. */
|
|
223
|
+
readonly bytes: number;
|
|
224
|
+
/** Rows the queries returned, when they said. */
|
|
225
|
+
readonly rows: number;
|
|
226
|
+
/** The query that produced most of them, or `null` when none reported. */
|
|
227
|
+
readonly sample: string | null;
|
|
228
|
+
/** Content type as it was sent, for the reader to judge by. */
|
|
229
|
+
readonly contentType: string | null;
|
|
230
|
+
readonly spanIds: readonly number[];
|
|
231
|
+
}
|
|
232
|
+
/** Evidence for the pool-wait detector: time queueing rather than querying. */
|
|
233
|
+
interface PoolWaitEvidence {
|
|
234
|
+
readonly kind: 'pool_wait';
|
|
235
|
+
/** Time the queries spent waiting for a free connection, ms. */
|
|
236
|
+
readonly waitMs: number;
|
|
237
|
+
/** Time those same queries spent actually running, ms. */
|
|
238
|
+
readonly runMs: number;
|
|
239
|
+
/** How many queries waited. */
|
|
240
|
+
readonly queries: number;
|
|
241
|
+
/** The query that waited longest, as the sample. */
|
|
242
|
+
readonly sample: string;
|
|
243
|
+
readonly spanIds: readonly number[];
|
|
244
|
+
}
|
|
245
|
+
/** Evidence for the transaction detectors: what a connection was held for. */
|
|
246
|
+
interface TransactionEvidence {
|
|
247
|
+
readonly kind: 'transaction';
|
|
248
|
+
/** Wall time from `BEGIN` to `COMMIT` or `ROLLBACK`, ms. */
|
|
249
|
+
readonly heldMs: number;
|
|
250
|
+
/** Of that, time inside queries — the rest is the connection idle in hand. */
|
|
251
|
+
readonly sqlMs: number;
|
|
252
|
+
/** Time inside outgoing HTTP calls made while it was open, ms. */
|
|
253
|
+
readonly externalMs: number;
|
|
254
|
+
/** Queries between the two ends, the ends themselves not counted. */
|
|
255
|
+
readonly queries: number;
|
|
256
|
+
/** What held it, when something did: `POST api.stripe.com/v1/charges`. */
|
|
257
|
+
readonly sample: string | null;
|
|
258
|
+
/** `COMMIT`, `ROLLBACK`, or `null` when the request ended with it open. */
|
|
259
|
+
readonly closedBy: string | null;
|
|
260
|
+
readonly spanIds: readonly number[];
|
|
261
|
+
}
|
|
262
|
+
/** Evidence for the budget detector: where a slow request spent its time. */
|
|
263
|
+
interface BudgetEvidence {
|
|
264
|
+
readonly kind: 'budget';
|
|
265
|
+
readonly durationMs: number;
|
|
266
|
+
readonly budgetMs: number;
|
|
267
|
+
/** Time inside outgoing HTTP calls, ms. */
|
|
268
|
+
readonly externalMs: number;
|
|
269
|
+
/** Time inside SQL queries, ms. */
|
|
270
|
+
readonly sqlMs: number;
|
|
271
|
+
/** Always empty: the finding is about the request, not about spans. */
|
|
272
|
+
readonly spanIds: readonly number[];
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Evidence for the slow-code detector: a stretch nothing accounts for.
|
|
276
|
+
*
|
|
277
|
+
* `coverage` travels with it because it is the reason the finding is willing
|
|
278
|
+
* to call the stretch code at all: it is the share of the *rest* of the
|
|
279
|
+
* request that instrumentation did account for. High, and the hole is
|
|
280
|
+
* genuinely the application's own work; low, and Reqray is simply blind to
|
|
281
|
+
* this process — which is why the detector stays quiet there instead of
|
|
282
|
+
* blaming code it cannot see.
|
|
283
|
+
*/
|
|
284
|
+
interface SlowCodeEvidence {
|
|
285
|
+
readonly kind: 'slow_code';
|
|
286
|
+
/** The unaccounted stretch itself, ms. */
|
|
287
|
+
readonly stretchMs: number;
|
|
288
|
+
/** Where it starts, ms from the beginning of the request. */
|
|
289
|
+
readonly atMs: number;
|
|
290
|
+
/** What share of the request's wall time it is, 0..1. */
|
|
291
|
+
readonly share: number;
|
|
292
|
+
/** How much of the time outside it was instrumented, 0..1. */
|
|
293
|
+
readonly coverage: number;
|
|
294
|
+
/** The handler or middleware it sits inside, or `null` at the top level. */
|
|
295
|
+
readonly label: string | null;
|
|
296
|
+
/** What ran just before it, or `null` when it opens the request. */
|
|
297
|
+
readonly before: string | null;
|
|
298
|
+
/** What ran just after it, or `null` when it ends the request. */
|
|
299
|
+
readonly after: string | null;
|
|
300
|
+
/** The spans that bracket the stretch — what the waterfall badges. */
|
|
301
|
+
readonly spanIds: readonly number[];
|
|
302
|
+
/**
|
|
303
|
+
* What was actually running in the stretch, heaviest first.
|
|
304
|
+
*
|
|
305
|
+
* Empty unless the sampling profiler is on. With it, the finding stops
|
|
306
|
+
* pointing at the boundary of the hole and points inside it — which is the
|
|
307
|
+
* difference between "somewhere between these two queries" and a line
|
|
308
|
+
* number.
|
|
309
|
+
*/
|
|
310
|
+
readonly frames: readonly HotFrame[];
|
|
311
|
+
/**
|
|
312
|
+
* Share of the stretch's samples that were on a processor, or `null` when
|
|
313
|
+
* nothing sampled it.
|
|
314
|
+
*
|
|
315
|
+
* Settles what the stretch itself cannot: near one it is code running, near
|
|
316
|
+
* zero the process was waiting on something with no instrumentation behind
|
|
317
|
+
* it.
|
|
318
|
+
*/
|
|
319
|
+
readonly busyShare: number | null;
|
|
320
|
+
}
|
|
321
|
+
/** Finding specifics. Extended as new detectors land. */
|
|
322
|
+
type FindingEvidence = NPlusOneEvidence | SequentialHttpEvidence | DuplicateEvidence | BudgetEvidence | HeavyResponseEvidence | PoolWaitEvidence | TransactionEvidence | SlowCodeEvidence;
|
|
323
|
+
/** Detector finding: what is wrong, where, what it costs and how to fix it. */
|
|
324
|
+
interface Finding {
|
|
325
|
+
/** Detector id, e.g. `n_plus_one`. */
|
|
326
|
+
readonly detector: string;
|
|
327
|
+
readonly severity: FindingSeverity;
|
|
328
|
+
/** One line for the block heading. */
|
|
329
|
+
readonly title: string;
|
|
330
|
+
/**
|
|
331
|
+
* Milliseconds that come back if the problem is fixed.
|
|
332
|
+
*
|
|
333
|
+
* Zero when the cost of the problem is not time — a response that is too
|
|
334
|
+
* large costs bytes, and the seconds it takes to reach a phone are not
|
|
335
|
+
* something this process measured. A client shows what the evidence says
|
|
336
|
+
* instead of printing "0 ms recoverable".
|
|
337
|
+
*/
|
|
338
|
+
readonly costMs: number;
|
|
339
|
+
readonly callsite: Callsite | null;
|
|
340
|
+
readonly evidence: FindingEvidence;
|
|
341
|
+
/** How to fix it. Tailored to the specific ORM where possible. */
|
|
342
|
+
readonly hint: string;
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* What the process was doing while the request was in flight.
|
|
346
|
+
*
|
|
347
|
+
* A property of the process, never of the request: under concurrency the code
|
|
348
|
+
* that blocked the loop is usually somebody else's. Read as "the loop was
|
|
349
|
+
* behind by this much while this ran", never as "this request burned this
|
|
350
|
+
* much CPU".
|
|
351
|
+
*/
|
|
352
|
+
interface HostState {
|
|
353
|
+
/** Mean event-loop delay over the sampling window, ms. */
|
|
354
|
+
readonly loopDelayMs: number;
|
|
355
|
+
/** The worst delay in that window — what "blocked" means, ms. */
|
|
356
|
+
readonly loopMaxMs: number;
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Where the request's time went.
|
|
360
|
+
*
|
|
361
|
+
* Each figure is a union of the intervals of its own kind, not a sum of
|
|
362
|
+
* durations: four 100 ms queries inside a 120 ms request ran concurrently and
|
|
363
|
+
* cost 120 ms of it, not 400.
|
|
364
|
+
*/
|
|
365
|
+
interface RequestTiming {
|
|
366
|
+
/** Time inside SQL queries, ms. */
|
|
367
|
+
readonly sqlMs: number;
|
|
368
|
+
/** Time inside outgoing HTTP calls, ms. */
|
|
369
|
+
readonly externalMs: number;
|
|
370
|
+
/** Time inside cache operations, ms. */
|
|
371
|
+
readonly cacheMs: number;
|
|
372
|
+
/**
|
|
373
|
+
* Time covered by no instrumented work, ms.
|
|
374
|
+
*
|
|
375
|
+
* The application's own code, a timer, or something Reqray has no
|
|
376
|
+
* instrumentation for. Not "CPU this request burned": under concurrency the
|
|
377
|
+
* process may have been running somebody else's.
|
|
378
|
+
*/
|
|
379
|
+
readonly selfMs: number;
|
|
380
|
+
/**
|
|
381
|
+
* Instrumented work overlapped in time.
|
|
382
|
+
*
|
|
383
|
+
* When it did, the three figures above can sum past the wall clock, and a
|
|
384
|
+
* client should say so rather than print an addition that does not add up.
|
|
385
|
+
*/
|
|
386
|
+
readonly parallel: boolean;
|
|
387
|
+
}
|
|
388
|
+
/** A body as the buffer stores it: masked, serialized, size-capped. */
|
|
389
|
+
interface RecordedBody {
|
|
390
|
+
/** Serialized text; JSON when the original was structured. */
|
|
391
|
+
readonly text: string;
|
|
392
|
+
/** The text was cut at the configured limit. */
|
|
393
|
+
readonly truncated: boolean;
|
|
394
|
+
/**
|
|
395
|
+
* How big it was before the cut, in bytes.
|
|
396
|
+
*
|
|
397
|
+
* Recorded separately because `text.length` after truncation is the size of
|
|
398
|
+
* the limit, not the size of the body — and a panel that reports the limit
|
|
399
|
+
* back as a measurement is reporting its own settings.
|
|
400
|
+
*/
|
|
401
|
+
readonly bytes: number;
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* What the request moved.
|
|
405
|
+
*
|
|
406
|
+
* The honest answer to "where did the memory go". Node has no per-request
|
|
407
|
+
* memory to report — `process.memoryUsage()` around a request under
|
|
408
|
+
* concurrency and garbage collection is noise, and sometimes negative — but
|
|
409
|
+
* what a request pulled out of the database and pushed back to the client is
|
|
410
|
+
* knowable, and it is what the spike was made of.
|
|
411
|
+
*/
|
|
412
|
+
interface RequestWeight {
|
|
413
|
+
/** Bytes the client sent, or `null` when nothing said. */
|
|
414
|
+
readonly bytesIn: number | null;
|
|
415
|
+
/** Bytes sent back, or `null` when nothing said. */
|
|
416
|
+
readonly bytesOut: number | null;
|
|
417
|
+
/** Rows returned across every query that reported a count. */
|
|
418
|
+
readonly rows: number;
|
|
419
|
+
/** The largest single result, in rows. */
|
|
420
|
+
readonly biggestRows: number;
|
|
421
|
+
}
|
|
422
|
+
/** A completed request, whole. */
|
|
423
|
+
interface RecordedRequest {
|
|
424
|
+
readonly id: string;
|
|
425
|
+
readonly method: string;
|
|
426
|
+
readonly path: string;
|
|
427
|
+
readonly query: string | null;
|
|
428
|
+
readonly status: number;
|
|
429
|
+
readonly durationMs: number;
|
|
430
|
+
/** Where that duration went. */
|
|
431
|
+
readonly timing: RequestTiming;
|
|
432
|
+
/** What it moved. */
|
|
433
|
+
readonly weight: RequestWeight;
|
|
434
|
+
/**
|
|
435
|
+
* What it cost to run, as distinct from how long it took.
|
|
436
|
+
*
|
|
437
|
+
* `null` for records written before this was measured: a panel that showed
|
|
438
|
+
* a blank cost for yesterday's request would be reporting its own age as
|
|
439
|
+
* the request's fault.
|
|
440
|
+
*/
|
|
441
|
+
readonly cost: RequestCost | null;
|
|
442
|
+
/**
|
|
443
|
+
* How the event loop was behaving at the time, or `null` when nothing was
|
|
444
|
+
* measuring it.
|
|
445
|
+
*/
|
|
446
|
+
readonly host: HostState | null;
|
|
447
|
+
/** Request start time, epoch ms. */
|
|
448
|
+
readonly startedAt: number;
|
|
449
|
+
readonly spans: readonly Span[];
|
|
450
|
+
readonly findings: readonly Finding[];
|
|
451
|
+
readonly requestHeaders: Readonly<Record<string, string>>;
|
|
452
|
+
readonly responseHeaders: Readonly<Record<string, string>>;
|
|
453
|
+
readonly requestBody: RecordedBody | null;
|
|
454
|
+
readonly responseBody: RecordedBody | null;
|
|
455
|
+
readonly logs: readonly LogEntry[];
|
|
456
|
+
readonly error: SpanError | null;
|
|
457
|
+
/** How many spans had to be dropped because of the limit. */
|
|
458
|
+
readonly droppedSpans: number;
|
|
459
|
+
/** How many log lines had to be dropped because of the per-request cap. */
|
|
460
|
+
readonly droppedLogs: number;
|
|
461
|
+
/** The test that issued the request, or `null` for ordinary traffic. */
|
|
462
|
+
readonly test: string | null;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* The panel API, as a client sees it.
|
|
467
|
+
*
|
|
468
|
+
* One endpoint, one response type. What the server needs to *produce* these —
|
|
469
|
+
* stores, filters, cursors — stays in `@reqray/core`: a client has no use for
|
|
470
|
+
* it and should not have to compile it.
|
|
471
|
+
*/
|
|
472
|
+
|
|
473
|
+
/** A list row — exactly what a request table shows, and nothing heavier. */
|
|
474
|
+
interface RequestRow {
|
|
475
|
+
readonly id: string;
|
|
476
|
+
readonly method: string;
|
|
477
|
+
readonly path: string;
|
|
478
|
+
readonly query: string | null;
|
|
479
|
+
/** The path with its variable segments collapsed (`/api/orders/:id`). */
|
|
480
|
+
readonly route: string;
|
|
481
|
+
readonly status: number;
|
|
482
|
+
readonly durationMs: number;
|
|
483
|
+
readonly startedAt: number;
|
|
484
|
+
readonly sqlCount: number;
|
|
485
|
+
/** Outgoing HTTP calls — what "slow, and it called someone" is made of. */
|
|
486
|
+
readonly httpCount: number;
|
|
487
|
+
readonly nPlusOne: boolean;
|
|
488
|
+
/** How many findings the detectors produced. */
|
|
489
|
+
readonly findingCount: number;
|
|
490
|
+
/** The detector behind the costliest finding, for the flag in the list. */
|
|
491
|
+
readonly flag: string | null;
|
|
492
|
+
readonly hasError: boolean;
|
|
493
|
+
/**
|
|
494
|
+
* Processor time in the request's window, ms, or `null` when unmeasured.
|
|
495
|
+
*
|
|
496
|
+
* On the row rather than only on the record because the whole point of it
|
|
497
|
+
* is to be visible while scanning: duration alone cannot tell an expensive
|
|
498
|
+
* request from a patient one.
|
|
499
|
+
*/
|
|
500
|
+
readonly cpuMs: number | null;
|
|
501
|
+
/**
|
|
502
|
+
* Of the wall clock, how much of it was spent on a processor.
|
|
503
|
+
*
|
|
504
|
+
* Above `1` when more than one thread worked for the request; a client
|
|
505
|
+
* clamps the bar it draws, never the number it prints.
|
|
506
|
+
*/
|
|
507
|
+
readonly cpuShare: number | null;
|
|
508
|
+
/** Held past its turn in the ring buffer, and exempt from filters. */
|
|
509
|
+
readonly pinned: boolean;
|
|
510
|
+
/** The test that issued the request, or `null` for ordinary traffic. */
|
|
511
|
+
readonly test: string | null;
|
|
512
|
+
}
|
|
513
|
+
/** Numbers for a status bar: over the whole store, not over the page. */
|
|
514
|
+
interface RequestSummary {
|
|
515
|
+
readonly shown: number;
|
|
516
|
+
readonly total: number;
|
|
517
|
+
readonly slow: number;
|
|
518
|
+
readonly errors: number;
|
|
519
|
+
readonly withFindings: number;
|
|
520
|
+
}
|
|
521
|
+
/** `GET /api/requests` — one page of the list. */
|
|
522
|
+
interface RequestsResponse {
|
|
523
|
+
readonly requests: readonly RequestRow[];
|
|
524
|
+
readonly summary: RequestSummary;
|
|
525
|
+
/** Feed back as `cursor` for the next page. `null` — the end. */
|
|
526
|
+
readonly nextCursor: string | null;
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* `GET /api/requests/:id` — one request, whole.
|
|
530
|
+
*
|
|
531
|
+
* The row fields travel with the record: a client that has a row on screen
|
|
532
|
+
* must not have to recompute `route` or `sqlCount` to render the detail.
|
|
533
|
+
*/
|
|
534
|
+
type RequestDetail = RequestRow & RecordedRequest;
|
|
535
|
+
/**
|
|
536
|
+
* How one call compares against other calls of the same route.
|
|
537
|
+
*
|
|
538
|
+
* A duration on its own means nothing: 400 ms is alarming for a cache read
|
|
539
|
+
* and excellent for a report. The only baseline worth comparing against is
|
|
540
|
+
* the route's own history.
|
|
541
|
+
*/
|
|
542
|
+
interface DurationBaseline {
|
|
543
|
+
readonly method: string;
|
|
544
|
+
readonly route: string;
|
|
545
|
+
/** Comparable calls the numbers rest on — this one is not among them. */
|
|
546
|
+
readonly samples: number;
|
|
547
|
+
/** The stretch of time those calls cover, ms. */
|
|
548
|
+
readonly windowMs: number;
|
|
549
|
+
readonly avgMs: number;
|
|
550
|
+
/**
|
|
551
|
+
* `null` below the sample count at which a p95 means anything.
|
|
552
|
+
*
|
|
553
|
+
* A ninety-fifth percentile of five calls is one call wearing a statistic's
|
|
554
|
+
* name, and a client is better told there isn't one than handed it.
|
|
555
|
+
*/
|
|
556
|
+
readonly p95Ms: number | null;
|
|
557
|
+
/** The median — honest at far smaller samples than the tails. */
|
|
558
|
+
readonly p50Ms: number;
|
|
559
|
+
/** `null` under the same rule as p95: a tail needs samples to be a tail. */
|
|
560
|
+
readonly p99Ms: number | null;
|
|
561
|
+
/** The slowest comparable call — what the rail's strip is scaled to. */
|
|
562
|
+
readonly maxMs: number;
|
|
563
|
+
/** Never `slower` without a p95 to be slower than. */
|
|
564
|
+
readonly verdict: 'faster' | 'typical' | 'slower';
|
|
565
|
+
}
|
|
566
|
+
/** One half of a host-pressure comparison. */
|
|
567
|
+
interface HostPressureSide {
|
|
568
|
+
readonly calls: number;
|
|
569
|
+
readonly p95Ms: number;
|
|
570
|
+
readonly avgMs: number;
|
|
571
|
+
}
|
|
572
|
+
/**
|
|
573
|
+
* What the route looked like when the process was struggling.
|
|
574
|
+
*
|
|
575
|
+
* A route's own calls, split by whether the event loop was in its own top
|
|
576
|
+
* quartile at the time. Evidence that the two moved together — not proof that
|
|
577
|
+
* one caused the other, which is why both halves travel with it.
|
|
578
|
+
*/
|
|
579
|
+
interface HostPressure {
|
|
580
|
+
/** Which host metric was tested. Only the event loop, for now. */
|
|
581
|
+
readonly metric: 'loop';
|
|
582
|
+
/** The top-quartile boundary, ms — printed, so the claim can be checked. */
|
|
583
|
+
readonly cutoffMs: number;
|
|
584
|
+
/** How many times slower the elevated half's p95 was. */
|
|
585
|
+
readonly ratio: number;
|
|
586
|
+
/** Share of calls that landed in the elevated half, percent. */
|
|
587
|
+
readonly share: number;
|
|
588
|
+
readonly elevated: HostPressureSide;
|
|
589
|
+
readonly normal: HostPressureSide;
|
|
590
|
+
}
|
|
591
|
+
/**
|
|
592
|
+
* `GET /api/requests/:id/baseline`.
|
|
593
|
+
*
|
|
594
|
+
* `null` when there is nothing to compare against: fewer than two other calls
|
|
595
|
+
* to the route, or a store that cannot answer the question. Absence is an
|
|
596
|
+
* ordinary answer here, not an error.
|
|
597
|
+
*/
|
|
598
|
+
interface BaselineResponse {
|
|
599
|
+
readonly baseline: DurationBaseline | null;
|
|
600
|
+
/**
|
|
601
|
+
* Whether this route is slower when the host is under strain.
|
|
602
|
+
*
|
|
603
|
+
* `null` far more often than not: it takes forty measured calls, a loop
|
|
604
|
+
* that actually varied, and a difference worth a sentence.
|
|
605
|
+
*/
|
|
606
|
+
readonly pressure: HostPressure | null;
|
|
607
|
+
}
|
|
608
|
+
/**
|
|
609
|
+
* Operating mode.
|
|
610
|
+
*
|
|
611
|
+
* It is a wire value as much as a setting: the panel reports the mode the
|
|
612
|
+
* process is running in, and what it may offer depends on it.
|
|
613
|
+
*/
|
|
614
|
+
type ReqrayMode = 'development' | 'production';
|
|
615
|
+
/** `GET /api/meta` — what the process behind the panel is. */
|
|
616
|
+
interface PanelMeta {
|
|
617
|
+
readonly pid: number;
|
|
618
|
+
/** When the process started, epoch ms. */
|
|
619
|
+
readonly startedAt: number;
|
|
620
|
+
readonly mode: ReqrayMode;
|
|
621
|
+
/** How many requests the store keeps. */
|
|
622
|
+
readonly bufferSize: number;
|
|
623
|
+
readonly replayEnabled: boolean;
|
|
624
|
+
readonly blameEnabled: boolean;
|
|
625
|
+
/**
|
|
626
|
+
* Every detector this process knows, with its resolved thresholds.
|
|
627
|
+
*
|
|
628
|
+
* `options` is `null` for a detector somebody turned off. What the findings
|
|
629
|
+
* tab shows when it has nothing to show — an empty work list must say what
|
|
630
|
+
* was looking, or it reads as "the code is clean" when the detector that
|
|
631
|
+
* would have said otherwise was disabled.
|
|
632
|
+
*/
|
|
633
|
+
readonly detectors: readonly DetectorSetting[];
|
|
634
|
+
}
|
|
635
|
+
/** One detector, as `/api/meta` reports it. */
|
|
636
|
+
interface DetectorSetting {
|
|
637
|
+
readonly id: string;
|
|
638
|
+
readonly enabled: boolean;
|
|
639
|
+
/** The resolved thresholds it runs with, or `null` when disabled. */
|
|
640
|
+
readonly options: Record<string, number | boolean | string> | null;
|
|
641
|
+
}
|
|
642
|
+
/**
|
|
643
|
+
* How every endpoint reports a refusal.
|
|
644
|
+
*
|
|
645
|
+
* One sentence addressed to a person: the panel answers browsers and command
|
|
646
|
+
* lines, and neither has anywhere to put an error code.
|
|
647
|
+
*/
|
|
648
|
+
interface ApiError {
|
|
649
|
+
readonly error: string;
|
|
650
|
+
}
|
|
651
|
+
/** How the list may be sorted. */
|
|
652
|
+
type RequestSort = 'recent' | 'slowest';
|
|
653
|
+
|
|
654
|
+
/**
|
|
655
|
+
* `GET /api/exceptions` — what threw, grouped.
|
|
656
|
+
*
|
|
657
|
+
* The same error raised three hundred times is one row with a repeat count,
|
|
658
|
+
* not three hundred rows. What the *grouping* costs — stack normalisation,
|
|
659
|
+
* hashing, the frame parser — stays in `@reqray/core`; a client receives the
|
|
660
|
+
* groups already formed.
|
|
661
|
+
*/
|
|
662
|
+
/** A stack frame as the panel shows it. */
|
|
663
|
+
interface ExceptionFrame {
|
|
664
|
+
/** The original stack line. */
|
|
665
|
+
readonly raw: string;
|
|
666
|
+
readonly file: string | null;
|
|
667
|
+
readonly line: number | null;
|
|
668
|
+
/** The frame belongs to project code — the panel highlights those. */
|
|
669
|
+
readonly project: boolean;
|
|
670
|
+
}
|
|
671
|
+
/** A group of identical exceptions. */
|
|
672
|
+
interface ExceptionGroup {
|
|
673
|
+
/** Stable group identifier: hash of the normalised stack. */
|
|
674
|
+
readonly id: string;
|
|
675
|
+
/** Exception type: `TypeError`, `ZodError`. */
|
|
676
|
+
readonly type: string;
|
|
677
|
+
readonly message: string;
|
|
678
|
+
/** First project frame: `services/pricing.js:61`. */
|
|
679
|
+
readonly origin: string | null;
|
|
680
|
+
/** Where it happened: `POST /api/orders`. */
|
|
681
|
+
readonly where: string | null;
|
|
682
|
+
readonly count: number;
|
|
683
|
+
/** Time of the last occurrence, epoch ms. */
|
|
684
|
+
readonly lastSeenAt: number;
|
|
685
|
+
/** Ids of the requests it happened in — newest first. */
|
|
686
|
+
readonly requestIds: readonly string[];
|
|
687
|
+
readonly frames: readonly ExceptionFrame[];
|
|
688
|
+
/** Histogram of occurrences over time, for the sparkline. */
|
|
689
|
+
readonly buckets: readonly number[];
|
|
690
|
+
/**
|
|
691
|
+
* A test that reproduced this exception, when one of the requests carried a
|
|
692
|
+
* test name. The most recent one wins — it is the one to run again.
|
|
693
|
+
*/
|
|
694
|
+
readonly test: string | null;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
/**
|
|
698
|
+
* The findings tab: recorded occurrences, grouped into a work list.
|
|
699
|
+
*
|
|
700
|
+
* The list screen answers "what ran"; this contract answers "what is worth
|
|
701
|
+
* fixing". Occurrences group by detector and code location rather than by
|
|
702
|
+
* request — two routes both firing N+1 at the same line are one problem, and
|
|
703
|
+
* eight hundred occurrences are usually a handful of patterns.
|
|
704
|
+
*/
|
|
705
|
+
|
|
706
|
+
/**
|
|
707
|
+
* Where a pattern stands in somebody's work.
|
|
708
|
+
*
|
|
709
|
+
* `new` and `ack` are the reader's own bookkeeping. `muted` hides the pattern
|
|
710
|
+
* and stops it flagging list rows — the detector keeps running, so unmuting
|
|
711
|
+
* has history to show. `fixed` is a guess, never a promise: the pattern has
|
|
712
|
+
* not fired since the file it points at last changed, which a client renders
|
|
713
|
+
* with the question mark it deserves.
|
|
714
|
+
*/
|
|
715
|
+
type PatternState = 'new' | 'ack' | 'muted' | 'fixed';
|
|
716
|
+
/** The states a client may set; `fixed` is computed and cannot be. */
|
|
717
|
+
type StoredPatternState = 'new' | 'ack' | 'muted';
|
|
718
|
+
/**
|
|
719
|
+
* The states a store actually keeps.
|
|
720
|
+
*
|
|
721
|
+
* `new` is the absence of a row rather than a value: a pattern nobody has
|
|
722
|
+
* touched costs no storage, and reopening one forgets it again.
|
|
723
|
+
*/
|
|
724
|
+
type FiledPatternState = Exclude<StoredPatternState, 'new'>;
|
|
725
|
+
/** One route a pattern fired on, with how often. */
|
|
726
|
+
interface PatternRoute {
|
|
727
|
+
readonly method: string;
|
|
728
|
+
readonly route: string;
|
|
729
|
+
readonly calls: number;
|
|
730
|
+
}
|
|
731
|
+
/** One of the worst occurrences, as a way into the request behind it. */
|
|
732
|
+
interface PatternExample {
|
|
733
|
+
readonly requestId: string;
|
|
734
|
+
readonly startedAt: number;
|
|
735
|
+
readonly method: string;
|
|
736
|
+
readonly route: string;
|
|
737
|
+
readonly status: number;
|
|
738
|
+
readonly durationMs: number;
|
|
739
|
+
/** What this occurrence cost, ms. */
|
|
740
|
+
readonly costMs: number;
|
|
741
|
+
}
|
|
742
|
+
/** One problem, wherever and however often it fired. */
|
|
743
|
+
interface FindingPattern {
|
|
744
|
+
/** Stable key: detector plus code location (or route, when no location). */
|
|
745
|
+
readonly id: string;
|
|
746
|
+
readonly detector: string;
|
|
747
|
+
readonly severity: FindingSeverity;
|
|
748
|
+
/** One plain sentence, from the most recent occurrence. */
|
|
749
|
+
readonly title: string;
|
|
750
|
+
/** How to fix it, from the most recent occurrence. */
|
|
751
|
+
readonly hint: string;
|
|
752
|
+
readonly callsite: Callsite | null;
|
|
753
|
+
readonly occurrences: number;
|
|
754
|
+
/**
|
|
755
|
+
* Milliseconds that come back if the pattern is fixed, summed over the
|
|
756
|
+
* occurrences in the window. Zero when the cost is not time.
|
|
757
|
+
*/
|
|
758
|
+
readonly recoverableMs: number;
|
|
759
|
+
/** Routes it fired on, busiest first. */
|
|
760
|
+
readonly routes: readonly PatternRoute[];
|
|
761
|
+
readonly firstSeen: number;
|
|
762
|
+
readonly lastSeen: number;
|
|
763
|
+
readonly state: PatternState;
|
|
764
|
+
/** The worst occurrences, costliest first — each opens a request. */
|
|
765
|
+
readonly examples: readonly PatternExample[];
|
|
766
|
+
}
|
|
767
|
+
/** What `/api/findings` answers. */
|
|
768
|
+
interface FindingsResponse {
|
|
769
|
+
/** Sorted by recoverable time, never by recency — the list does recency. */
|
|
770
|
+
readonly patterns: readonly FindingPattern[];
|
|
771
|
+
/** Occurrences behind the patterns, muted ones included. */
|
|
772
|
+
readonly occurrences: number;
|
|
773
|
+
/** Recoverable ms across every pattern that is not muted. */
|
|
774
|
+
readonly recoverableMs: number;
|
|
775
|
+
/** The store stopped reading before the window ended. */
|
|
776
|
+
readonly truncated: boolean;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
/**
|
|
780
|
+
* `GET /api/project` — what Reqray knows about the application it watches.
|
|
781
|
+
*
|
|
782
|
+
* The startup report, served rather than only printed: "why do I not see my
|
|
783
|
+
* SQL" is asked hours after the line has scrolled away.
|
|
784
|
+
*
|
|
785
|
+
* Nothing secret is on the wire here. Environment variables are not read, the
|
|
786
|
+
* panel gate is reported as present or absent rather than by value, and the
|
|
787
|
+
* masking lists are field *names*, which is what makes them safe to show and
|
|
788
|
+
* useful to check.
|
|
789
|
+
*/
|
|
790
|
+
/** One report line: one package Reqray tried to instrument. */
|
|
791
|
+
interface DiagnosticEntry {
|
|
792
|
+
/** Package name as the application sees it: `fastify`, `pg`, `prisma`. */
|
|
793
|
+
readonly name: string;
|
|
794
|
+
/** Package version, if it could be resolved. */
|
|
795
|
+
readonly version?: string | undefined;
|
|
796
|
+
/** Package is built into Node — no version is printed. */
|
|
797
|
+
readonly builtin?: boolean;
|
|
798
|
+
/** What is captured: "requests", "SQL", "outgoing HTTP". */
|
|
799
|
+
readonly captures: string;
|
|
800
|
+
readonly ok: boolean;
|
|
801
|
+
/** Why it failed. Printed instead of `captures` for failed entries. */
|
|
802
|
+
readonly reason?: string | undefined;
|
|
803
|
+
/** What the user should do to fix it. */
|
|
804
|
+
readonly hint?: string | undefined;
|
|
805
|
+
}
|
|
806
|
+
/** A connection pool as it stands at the moment it is read. */
|
|
807
|
+
interface PoolReading {
|
|
808
|
+
/** Which driver it belongs to: `pg`, `mysql2`. */
|
|
809
|
+
readonly source: string;
|
|
810
|
+
/** Connections it is allowed to open. */
|
|
811
|
+
readonly max: number;
|
|
812
|
+
/** Connections open at this moment. */
|
|
813
|
+
readonly total: number;
|
|
814
|
+
/** Of those, sitting idle. */
|
|
815
|
+
readonly idle: number;
|
|
816
|
+
/** Acquires queued for a connection right now. */
|
|
817
|
+
readonly waiting: number;
|
|
818
|
+
}
|
|
819
|
+
/** A reading, with the identity that makes two readings comparable. */
|
|
820
|
+
interface PoolStats extends PoolReading {
|
|
821
|
+
/**
|
|
822
|
+
* Stable for as long as the pool lives.
|
|
823
|
+
*
|
|
824
|
+
* An application with two pools — one for reads, one for writes — shows two
|
|
825
|
+
* rows, and without an id there would be nothing to tell them apart from
|
|
826
|
+
* one reading to the next but their position in a list.
|
|
827
|
+
*/
|
|
828
|
+
readonly id: number;
|
|
829
|
+
}
|
|
830
|
+
/** How long anything kept is kept for. Also the body of `POST /api/retention`. */
|
|
831
|
+
interface RetentionLimits {
|
|
832
|
+
/** How old a request may be, in days. */
|
|
833
|
+
readonly days: number | null;
|
|
834
|
+
/** How much disk everything kept may take, in bytes. */
|
|
835
|
+
readonly maxBytes: number | null;
|
|
836
|
+
/** How many requests to keep. */
|
|
837
|
+
readonly maxRequests: number | null;
|
|
838
|
+
}
|
|
839
|
+
/**
|
|
840
|
+
* When a request is kept, as the panel reports it.
|
|
841
|
+
*
|
|
842
|
+
* Here rather than in core's config so the runtime and the screen showing it
|
|
843
|
+
* cannot drift: the panel is where somebody checks whether sampling explains a
|
|
844
|
+
* missing request.
|
|
845
|
+
*/
|
|
846
|
+
interface SamplingSettings {
|
|
847
|
+
readonly rate: number;
|
|
848
|
+
readonly slowMs: number;
|
|
849
|
+
readonly alwaysOnError: boolean;
|
|
850
|
+
readonly alwaysOnFinding: boolean;
|
|
851
|
+
}
|
|
852
|
+
/** How much stack is captured, and what counts as project code. @see SamplingSettings */
|
|
853
|
+
interface StackSettings {
|
|
854
|
+
readonly limit: number;
|
|
855
|
+
readonly maxPerFingerprint: number;
|
|
856
|
+
readonly projectRoot: string;
|
|
857
|
+
readonly exclude: readonly string[];
|
|
858
|
+
}
|
|
859
|
+
/** The application, as its own manifest and repository describe it. */
|
|
860
|
+
interface ProjectApp {
|
|
861
|
+
readonly name: string | null;
|
|
862
|
+
readonly version: string | null;
|
|
863
|
+
/** Directory Reqray treats as project code. */
|
|
864
|
+
readonly root: string;
|
|
865
|
+
readonly git: GitHead | null;
|
|
866
|
+
}
|
|
867
|
+
/** Which build is running — the first thing asked of a staging panel. */
|
|
868
|
+
interface GitHead {
|
|
869
|
+
readonly branch: string | null;
|
|
870
|
+
readonly sha: string | null;
|
|
871
|
+
/** Uncommitted changes in the working tree. */
|
|
872
|
+
readonly dirty: boolean;
|
|
873
|
+
}
|
|
874
|
+
/** The process doing the recording. */
|
|
875
|
+
interface ProjectRuntime {
|
|
876
|
+
readonly node: string;
|
|
877
|
+
readonly platform: string;
|
|
878
|
+
readonly arch: string;
|
|
879
|
+
readonly pid: number;
|
|
880
|
+
/** When the process started, epoch ms. */
|
|
881
|
+
readonly startedAt: number;
|
|
882
|
+
readonly rssMb: number;
|
|
883
|
+
readonly heapUsedMb: number;
|
|
884
|
+
}
|
|
885
|
+
/** What the store holds right now. Absent for a store that does not say. */
|
|
886
|
+
interface ProjectStorage {
|
|
887
|
+
readonly name: string;
|
|
888
|
+
readonly size: number;
|
|
889
|
+
readonly capacity: number | null;
|
|
890
|
+
readonly evicted: number | null;
|
|
891
|
+
readonly oldestAt: number | null;
|
|
892
|
+
readonly pinned: number | null;
|
|
893
|
+
/** Bytes on disk, for a store that has any. */
|
|
894
|
+
readonly bytes: number | null;
|
|
895
|
+
}
|
|
896
|
+
/** What the log on disk holds, when there is one. */
|
|
897
|
+
interface ProjectLog {
|
|
898
|
+
readonly dir: string;
|
|
899
|
+
readonly files: number;
|
|
900
|
+
readonly bytes: number;
|
|
901
|
+
/** Local midnight of the oldest day still on disk. */
|
|
902
|
+
readonly oldestAt: number | null;
|
|
903
|
+
readonly written: number;
|
|
904
|
+
readonly dropped: number;
|
|
905
|
+
/** `false` once a write failed: the log is off, the application is not. */
|
|
906
|
+
readonly writing: boolean;
|
|
907
|
+
}
|
|
908
|
+
/** How long anything kept is kept for, and whether that can be changed here. */
|
|
909
|
+
interface ProjectRetention extends RetentionLimits {
|
|
910
|
+
/** Whether the panel may change it. */
|
|
911
|
+
readonly writable: boolean;
|
|
912
|
+
/** Whether a change outlives the process. */
|
|
913
|
+
readonly remembered: boolean;
|
|
914
|
+
}
|
|
915
|
+
/** Reqray's own settings, as the project screen shows them. */
|
|
916
|
+
interface ProjectReqray {
|
|
917
|
+
readonly version: string | null;
|
|
918
|
+
readonly mode: string;
|
|
919
|
+
readonly enabled: boolean;
|
|
920
|
+
readonly isLocalDevelopment: boolean;
|
|
921
|
+
readonly bufferSize: number;
|
|
922
|
+
readonly maxSpansPerRequest: number;
|
|
923
|
+
readonly sampling: SamplingSettings;
|
|
924
|
+
readonly replay: boolean;
|
|
925
|
+
readonly explain: boolean;
|
|
926
|
+
readonly blame: boolean;
|
|
927
|
+
readonly logs: boolean;
|
|
928
|
+
readonly collectSqlValues: boolean;
|
|
929
|
+
/** Mount path, and whether access is gated. Never the gate itself. */
|
|
930
|
+
readonly panel: {
|
|
931
|
+
readonly path: string;
|
|
932
|
+
readonly gated: boolean;
|
|
933
|
+
} | null;
|
|
934
|
+
readonly redact: {
|
|
935
|
+
readonly headers: readonly string[];
|
|
936
|
+
readonly body: readonly string[];
|
|
937
|
+
};
|
|
938
|
+
readonly detect: Readonly<Record<string, unknown>>;
|
|
939
|
+
readonly stack: StackSettings;
|
|
940
|
+
}
|
|
941
|
+
/** Everything the project screen shows. */
|
|
942
|
+
interface ProjectReport {
|
|
943
|
+
readonly app: ProjectApp;
|
|
944
|
+
readonly runtime: ProjectRuntime;
|
|
945
|
+
readonly reqray: ProjectReqray;
|
|
946
|
+
readonly instrumentation: readonly DiagnosticEntry[];
|
|
947
|
+
readonly storage: ProjectStorage | null;
|
|
948
|
+
/** `null` — nothing is written to disk as a log. */
|
|
949
|
+
readonly log: ProjectLog | null;
|
|
950
|
+
/** `null` — every store keeps to its own limits. */
|
|
951
|
+
readonly retention: ProjectRetention | null;
|
|
952
|
+
/**
|
|
953
|
+
* Every connection pool that has served a request, as it stands right now.
|
|
954
|
+
*
|
|
955
|
+
* Read at the moment the screen is opened rather than recorded with a
|
|
956
|
+
* request: a pool's size and its queue are facts about this instant, and a
|
|
957
|
+
* figure captured an hour ago would be a number that looks live and is not.
|
|
958
|
+
*/
|
|
959
|
+
readonly pools: readonly PoolStats[];
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
/**
|
|
963
|
+
* `GET /api/routes` and `GET /api/routes/:method/:route/series` — the routes
|
|
964
|
+
* screen and the three charts one row opens into.
|
|
965
|
+
*
|
|
966
|
+
* The aggregates are computed over whatever the store still holds, which is a
|
|
967
|
+
* session rather than a statistically sound window. That is a property of the
|
|
968
|
+
* answer, not a caveat to add at display time: `samples` and `windowMs` travel
|
|
969
|
+
* with it so a client can say what the numbers rest on.
|
|
970
|
+
*/
|
|
971
|
+
|
|
972
|
+
/**
|
|
973
|
+
* A detector that fired on a route, with what it cost the route.
|
|
974
|
+
*
|
|
975
|
+
* One entry per detector rather than per occurrence: the column is a set of
|
|
976
|
+
* badges, and the expansion needs the freshest occurrence's own words.
|
|
977
|
+
*/
|
|
978
|
+
interface RouteFinding {
|
|
979
|
+
readonly detector: string;
|
|
980
|
+
/** How many of the route's calls it fired on. */
|
|
981
|
+
readonly calls: number;
|
|
982
|
+
/** Milliseconds that come back across those calls. */
|
|
983
|
+
readonly recoverableMs: number;
|
|
984
|
+
/** From the most recent occurrence — a count in it must not be stale. */
|
|
985
|
+
readonly title: string;
|
|
986
|
+
readonly hint: string;
|
|
987
|
+
readonly callsite: Callsite | null;
|
|
988
|
+
}
|
|
989
|
+
/** One row of the routes table. */
|
|
990
|
+
interface RouteStats {
|
|
991
|
+
/** `GET /api/orders/:id` — method and normalized path. */
|
|
992
|
+
readonly method: string;
|
|
993
|
+
readonly route: string;
|
|
994
|
+
readonly calls: number;
|
|
995
|
+
/** Calls per second over the retained window. */
|
|
996
|
+
readonly rps: number;
|
|
997
|
+
readonly p50: number;
|
|
998
|
+
readonly p95: number;
|
|
999
|
+
readonly p99: number;
|
|
1000
|
+
/** Share of calls that failed, as a percentage. */
|
|
1001
|
+
readonly errorRate: number;
|
|
1002
|
+
/** Mean SQL queries per call. */
|
|
1003
|
+
readonly sqlAvg: number;
|
|
1004
|
+
/**
|
|
1005
|
+
* Mean bytes returned per call, over the calls that said how many.
|
|
1006
|
+
*
|
|
1007
|
+
* `null` when none of them did. Averaging a silent response in as zero
|
|
1008
|
+
* would rank the endpoint that returns megabytes below the one that
|
|
1009
|
+
* returns a status code.
|
|
1010
|
+
*/
|
|
1011
|
+
readonly bytesAvg: number | null;
|
|
1012
|
+
/** Share of all recorded request time this route accounts for, percent. */
|
|
1013
|
+
readonly timeShare: number;
|
|
1014
|
+
/**
|
|
1015
|
+
* What the detectors found here, costliest first.
|
|
1016
|
+
*
|
|
1017
|
+
* The reason to visit this screen: a table of latencies says which endpoint
|
|
1018
|
+
* is expensive, and this says whether anybody already knows why. Muted
|
|
1019
|
+
* patterns are left out — muting is presentation, and this is a shout.
|
|
1020
|
+
*/
|
|
1021
|
+
readonly findings: readonly RouteFinding[];
|
|
1022
|
+
/**
|
|
1023
|
+
* Calls per column over the window, ten of them.
|
|
1024
|
+
*
|
|
1025
|
+
* A shape, not a series: whether this endpoint is steady, bursty, or was
|
|
1026
|
+
* called twice an hour ago and never since.
|
|
1027
|
+
*/
|
|
1028
|
+
readonly trend: readonly number[];
|
|
1029
|
+
}
|
|
1030
|
+
/** `GET /api/routes`. */
|
|
1031
|
+
interface RoutesReport {
|
|
1032
|
+
readonly routes: readonly RouteStats[];
|
|
1033
|
+
/** How many requests the numbers are based on. */
|
|
1034
|
+
readonly samples: number;
|
|
1035
|
+
/** The span of time they cover, milliseconds. */
|
|
1036
|
+
readonly windowMs: number;
|
|
1037
|
+
/**
|
|
1038
|
+
* The oldest and newest request behind them, epoch ms.
|
|
1039
|
+
*
|
|
1040
|
+
* So that a chart drawn beside this table covers the same stretch: a table
|
|
1041
|
+
* describing thirteen minutes above a chart describing six hours is two
|
|
1042
|
+
* answers to one question.
|
|
1043
|
+
*/
|
|
1044
|
+
readonly from: number;
|
|
1045
|
+
readonly to: number;
|
|
1046
|
+
}
|
|
1047
|
+
/** One column of a route's chart. */
|
|
1048
|
+
interface SeriesBucket {
|
|
1049
|
+
/** When the column starts, epoch ms. */
|
|
1050
|
+
readonly at: number;
|
|
1051
|
+
readonly calls: number;
|
|
1052
|
+
readonly errors: number;
|
|
1053
|
+
/**
|
|
1054
|
+
* Percentiles over the calls in this column.
|
|
1055
|
+
*
|
|
1056
|
+
* Zero when there were none — a column with no traffic is a gap, and a
|
|
1057
|
+
* client draws it as one rather than as a line falling to the floor.
|
|
1058
|
+
*/
|
|
1059
|
+
readonly p50: number;
|
|
1060
|
+
readonly p95: number;
|
|
1061
|
+
readonly p99: number;
|
|
1062
|
+
}
|
|
1063
|
+
/** A route's three charts, as one answer. */
|
|
1064
|
+
interface RouteSeries {
|
|
1065
|
+
readonly method: string;
|
|
1066
|
+
readonly route: string;
|
|
1067
|
+
/** The stretch the columns cover, epoch ms. */
|
|
1068
|
+
readonly from: number;
|
|
1069
|
+
readonly to: number;
|
|
1070
|
+
/** How long one column is, ms — what throughput is per. */
|
|
1071
|
+
readonly bucketMs: number;
|
|
1072
|
+
readonly calls: number;
|
|
1073
|
+
readonly buckets: readonly SeriesBucket[];
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
/**
|
|
1077
|
+
* The history screen's contract: one metric over one period.
|
|
1078
|
+
*
|
|
1079
|
+
* A fixed list of metrics rather than a query language over the store. Every
|
|
1080
|
+
* one of them is something Reqray measured and already keeps per request, and
|
|
1081
|
+
* the list ends where the measurements do — which is the line between a way
|
|
1082
|
+
* of reading a history and a dashboard product.
|
|
1083
|
+
*/
|
|
1084
|
+
/** What a column of the history chart can show. */
|
|
1085
|
+
type SeriesMetric = 'p50' | 'p95' | 'p99'
|
|
1086
|
+
/** Requests per minute. */
|
|
1087
|
+
| 'throughput'
|
|
1088
|
+
/** Share of requests that failed, 0 to 1. */
|
|
1089
|
+
| 'errorRate'
|
|
1090
|
+
/** Mean queries per request. */
|
|
1091
|
+
| 'sqlPerRequest'
|
|
1092
|
+
/** Mean outgoing calls per request. */
|
|
1093
|
+
| 'httpPerRequest'
|
|
1094
|
+
/** Mean bytes sent to the client. */
|
|
1095
|
+
| 'bytes'
|
|
1096
|
+
/** Mean event-loop delay while these requests ran, ms. */
|
|
1097
|
+
| 'loopDelay'
|
|
1098
|
+
/** Mean findings per request. */
|
|
1099
|
+
| 'findingsPerRequest';
|
|
1100
|
+
/** One metric, one value per column. */
|
|
1101
|
+
interface MetricSeries {
|
|
1102
|
+
readonly metric: SeriesMetric;
|
|
1103
|
+
/**
|
|
1104
|
+
* `null` where the column has nothing to answer with.
|
|
1105
|
+
*
|
|
1106
|
+
* A stretch nobody called is not a zero — drawing it as one invents a floor
|
|
1107
|
+
* the traffic never touched. The client draws a void instead.
|
|
1108
|
+
*/
|
|
1109
|
+
readonly values: readonly (number | null)[];
|
|
1110
|
+
}
|
|
1111
|
+
/** What a period adds up to, as numbers rather than as a shape. */
|
|
1112
|
+
interface SeriesTotals {
|
|
1113
|
+
readonly calls: number;
|
|
1114
|
+
/** Share of calls that failed, 0 to 1. */
|
|
1115
|
+
readonly errorRate: number;
|
|
1116
|
+
readonly p50: number;
|
|
1117
|
+
readonly p95: number;
|
|
1118
|
+
readonly p99: number;
|
|
1119
|
+
/**
|
|
1120
|
+
* Wall time inside queries over the whole period, ms.
|
|
1121
|
+
*
|
|
1122
|
+
* `null` when nothing in the period recorded it — requests stored before
|
|
1123
|
+
* the store kept the figure, which is not the same as zero time in SQL.
|
|
1124
|
+
*/
|
|
1125
|
+
readonly sqlMs: number | null;
|
|
1126
|
+
/** Wall time covered by no instrumented work, ms. `null` as above. */
|
|
1127
|
+
readonly appMs: number | null;
|
|
1128
|
+
/** The endpoint called most often in the period. */
|
|
1129
|
+
readonly busiest: {
|
|
1130
|
+
readonly method: string;
|
|
1131
|
+
readonly route: string;
|
|
1132
|
+
readonly calls: number;
|
|
1133
|
+
} | null;
|
|
1134
|
+
/** The detector that fired on the most requests. */
|
|
1135
|
+
readonly topFinding: {
|
|
1136
|
+
readonly detector: string;
|
|
1137
|
+
readonly calls: number;
|
|
1138
|
+
} | null;
|
|
1139
|
+
}
|
|
1140
|
+
/** The answer to one reading of the history screen. */
|
|
1141
|
+
interface SeriesResponse {
|
|
1142
|
+
/** The period drawn, epoch ms. The columns span exactly this. */
|
|
1143
|
+
readonly from: number;
|
|
1144
|
+
readonly to: number;
|
|
1145
|
+
readonly bucketMs: number;
|
|
1146
|
+
/**
|
|
1147
|
+
* Requests per column.
|
|
1148
|
+
*
|
|
1149
|
+
* Carried separately from every metric because it is what tells an empty
|
|
1150
|
+
* stretch from a measured zero, and every metric needs that distinction.
|
|
1151
|
+
*/
|
|
1152
|
+
readonly calls: readonly number[];
|
|
1153
|
+
readonly series: readonly MetricSeries[];
|
|
1154
|
+
readonly totals: SeriesTotals;
|
|
1155
|
+
/**
|
|
1156
|
+
* The same numbers for the period of equal length immediately before.
|
|
1157
|
+
*
|
|
1158
|
+
* `null` when the store holds nothing there — a figure with nothing to
|
|
1159
|
+
* compare it against is better than one compared with an invented zero.
|
|
1160
|
+
*/
|
|
1161
|
+
readonly previous: SeriesTotals | null;
|
|
1162
|
+
/**
|
|
1163
|
+
* The primary metric over the period immediately before, same columns.
|
|
1164
|
+
*
|
|
1165
|
+
* Drawn behind the line as a ghost, so "worse than last week" is a shape
|
|
1166
|
+
* rather than a percentage. Only the first metric: a ghost behind each of
|
|
1167
|
+
* two lines is four lines on one chart, which is the wall of gauges this
|
|
1168
|
+
* screen exists not to be. `null` when nothing ran before the period.
|
|
1169
|
+
*/
|
|
1170
|
+
readonly ghost: readonly (number | null)[] | null;
|
|
1171
|
+
/**
|
|
1172
|
+
* The store stopped reading before the period ended.
|
|
1173
|
+
*
|
|
1174
|
+
* Said out loud rather than folded away: a total drawn from the most recent
|
|
1175
|
+
* fifty thousand requests of a busier period is a different number from the
|
|
1176
|
+
* one the reader thinks they are looking at.
|
|
1177
|
+
*/
|
|
1178
|
+
readonly truncated: boolean;
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
/**
|
|
1182
|
+
* The strip above the list, and what one of its columns opens into.
|
|
1183
|
+
*
|
|
1184
|
+
* `GET /api/timeline` draws the shape of the traffic; `GET /api/timeline/at`
|
|
1185
|
+
* answers the only question worth asking of a column — what was different
|
|
1186
|
+
* then. They are one flow, so they share a file: a client that draws the
|
|
1187
|
+
* strip is the client that will ask about a column of it.
|
|
1188
|
+
*/
|
|
1189
|
+
/** One column of the strip. The three counts never double-count. */
|
|
1190
|
+
interface TimelineBucket {
|
|
1191
|
+
/** Failed. */
|
|
1192
|
+
readonly err: number;
|
|
1193
|
+
/** Slow, but not failed. */
|
|
1194
|
+
readonly slow: number;
|
|
1195
|
+
readonly rest: number;
|
|
1196
|
+
readonly total: number;
|
|
1197
|
+
}
|
|
1198
|
+
/** The strip, and the stretch of time it covers. */
|
|
1199
|
+
interface TimelineReport {
|
|
1200
|
+
/** Oldest and newest request the store holds, epoch ms. */
|
|
1201
|
+
readonly from: number;
|
|
1202
|
+
readonly to: number;
|
|
1203
|
+
readonly buckets: readonly TimelineBucket[];
|
|
1204
|
+
}
|
|
1205
|
+
/**
|
|
1206
|
+
* A route that behaved unlike itself in the moment being asked about.
|
|
1207
|
+
*
|
|
1208
|
+
* Ranked by how far it strayed from its own behaviour, never by volume: by
|
|
1209
|
+
* volume the busiest endpoint tops every list and the moment explains nothing.
|
|
1210
|
+
*/
|
|
1211
|
+
interface Outlier {
|
|
1212
|
+
readonly method: string;
|
|
1213
|
+
readonly route: string;
|
|
1214
|
+
readonly calls: number;
|
|
1215
|
+
readonly avgMs: number;
|
|
1216
|
+
/** How many times its usual rate it ran at, or `null` when it is new. */
|
|
1217
|
+
readonly rateRatio: number | null;
|
|
1218
|
+
/** How many times its usual duration it took, or `null` when it is new. */
|
|
1219
|
+
readonly slowerRatio: number | null;
|
|
1220
|
+
/** It did not run at all in the rest of the window. */
|
|
1221
|
+
readonly firstSeen: boolean;
|
|
1222
|
+
}
|
|
1223
|
+
/** What was unusual in a moment, and how the question was answered. */
|
|
1224
|
+
interface ActivityReport {
|
|
1225
|
+
readonly from: number;
|
|
1226
|
+
readonly to: number;
|
|
1227
|
+
/** Calls in the moment, across every route. */
|
|
1228
|
+
readonly calls: number;
|
|
1229
|
+
/**
|
|
1230
|
+
* How much busier the moment was than the rest of the window, overall.
|
|
1231
|
+
*
|
|
1232
|
+
* `null` when there is no rest to compare against. This is the figure every
|
|
1233
|
+
* route is judged against: if the whole application ran six times as often
|
|
1234
|
+
* here, a route that ran six times as often did nothing unusual — the
|
|
1235
|
+
* traffic simply arrived — and a list of every endpoint is not an answer.
|
|
1236
|
+
*/
|
|
1237
|
+
readonly rateRatio: number | null;
|
|
1238
|
+
/** Ranked, most unlike itself first. Empty means nothing stood out. */
|
|
1239
|
+
readonly outliers: readonly Outlier[];
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1242
|
+
/**
|
|
1243
|
+
* The three tools that act on the machine rather than read from the store:
|
|
1244
|
+
* EXPLAIN a recorded query, replay a recorded request, blame a stack frame.
|
|
1245
|
+
*
|
|
1246
|
+
* They share a file because they share a gate. Each one reaches outside the
|
|
1247
|
+
* panel — into the database, back into the application, into `git` — and each
|
|
1248
|
+
* is off outside local development unless somebody turned it on deliberately.
|
|
1249
|
+
* A client should see them as one capability, because that is how they are
|
|
1250
|
+
* granted.
|
|
1251
|
+
*/
|
|
1252
|
+
/** One node of the plan tree, flattened for display. */
|
|
1253
|
+
interface ExplainPlanNode {
|
|
1254
|
+
readonly depth: number;
|
|
1255
|
+
/** `Seq Scan on line_items`, `Index Scan using orders_pkey on orders`. */
|
|
1256
|
+
readonly label: string;
|
|
1257
|
+
readonly rows: number | null;
|
|
1258
|
+
readonly cost: number | null;
|
|
1259
|
+
}
|
|
1260
|
+
/** A warning derived from the plan. */
|
|
1261
|
+
interface ExplainNote {
|
|
1262
|
+
readonly severity: 'warn' | 'info';
|
|
1263
|
+
readonly message: string;
|
|
1264
|
+
}
|
|
1265
|
+
/** What `POST /api/explain` answers. */
|
|
1266
|
+
interface ExplainResult {
|
|
1267
|
+
readonly sql: string;
|
|
1268
|
+
readonly nodes: readonly ExplainPlanNode[];
|
|
1269
|
+
readonly notes: readonly ExplainNote[];
|
|
1270
|
+
/** The raw plan, for those who want the full detail. */
|
|
1271
|
+
readonly plan: unknown;
|
|
1272
|
+
}
|
|
1273
|
+
/** What the panel asks to replay. */
|
|
1274
|
+
interface ReplayInput {
|
|
1275
|
+
readonly method: string;
|
|
1276
|
+
readonly path: string;
|
|
1277
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
1278
|
+
readonly body?: string | undefined;
|
|
1279
|
+
}
|
|
1280
|
+
/** Metrics of one run — what the comparison block shows. */
|
|
1281
|
+
interface ReplayMetrics {
|
|
1282
|
+
readonly status: number;
|
|
1283
|
+
readonly durationMs: number;
|
|
1284
|
+
readonly sqlCount: number;
|
|
1285
|
+
readonly nPlusOne: boolean;
|
|
1286
|
+
readonly bytes: number | null;
|
|
1287
|
+
readonly etag: string | null;
|
|
1288
|
+
}
|
|
1289
|
+
/** Original versus replay. */
|
|
1290
|
+
interface ReplayComparison {
|
|
1291
|
+
readonly original: ReplayMetrics;
|
|
1292
|
+
readonly replay: ReplayMetrics;
|
|
1293
|
+
/**
|
|
1294
|
+
* The replay's record could not be obtained — metrics were collected from
|
|
1295
|
+
* the response alone. The database query count is unknown in that case.
|
|
1296
|
+
*/
|
|
1297
|
+
readonly partial: boolean;
|
|
1298
|
+
}
|
|
1299
|
+
/** What blame knows about one line. */
|
|
1300
|
+
interface BlameLine {
|
|
1301
|
+
/** Abbreviated commit hash. */
|
|
1302
|
+
readonly sha: string;
|
|
1303
|
+
readonly author: string;
|
|
1304
|
+
/** Commit time, epoch ms. */
|
|
1305
|
+
readonly at: number;
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
export type { ActivityReport, ApiError, BaselineResponse, BlameLine, BudgetEvidence, CacheOperation, CacheSpan, Callsite, DbSpan, DetectorSetting, DiagnosticEntry, DuplicateEvidence, DurationBaseline, ExceptionFrame, ExceptionGroup, ExplainNote, ExplainPlanNode, ExplainResult, FiledPatternState, Finding, FindingEvidence, FindingPattern, FindingSeverity, FindingsResponse, GitHead, HandlerSpan, HeavyResponseEvidence, HostPressure, HostPressureSide, HostState, HotFrame, HttpSpan, LabelSpanKind, LogEntry, MetricSeries, MiddlewareSpan, NPlusOneEvidence, Outlier, PanelMeta, PatternExample, PatternRoute, PatternState, PoolReading, PoolStats, PoolWaitEvidence, ProjectApp, ProjectLog, ProjectReport, ProjectReqray, ProjectRetention, ProjectRuntime, ProjectStorage, RecordedBody, RecordedRequest, ReplayComparison, ReplayInput, ReplayMetrics, ReqrayMode, RequestCost, RequestDetail, RequestRow, RequestSort, RequestSummary, RequestTiming, RequestWeight, RequestsResponse, RetentionLimits, RouteFinding, RouteSeries, RouteStats, RoutesReport, SamplingSettings, SequentialHttpEvidence, SeriesBucket, SeriesMetric, SeriesResponse, SeriesTotals, SlowCodeEvidence, Span, SpanError, SpanKind, StackSettings, StoredPatternState, TimelineBucket, TimelineReport, TransactionEvidence };
|