@toa.io/extensions.introspection 1.0.0-alpha.304 → 1.0.0-alpha.306
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/components/introspection.edges/manifest.toa.yaml +4 -12
- package/components/introspection.edges/operations/merge.js +1 -4
- package/components/introspection.edges/source/merge.ts +0 -3
- package/components/introspection.edges/types/toa.d.ts +0 -12
- package/components/introspection.signals/manifest.toa.yaml +109 -0
- package/components/introspection.signals/operations/configuration.js +17 -0
- package/components/introspection.signals/source/configuration.ts +26 -0
- package/components/introspection.signals/tsconfig.json +10 -0
- package/components/introspection.signals/types/index.d.ts +3 -0
- package/components/introspection.signals/types/toa.d.ts +61 -0
- package/package.json +8 -8
- package/readme.md +7 -26
- package/transpiled/Factory.d.ts +11 -5
- package/transpiled/Factory.js +34 -37
- package/transpiled/Factory.js.map +1 -1
- package/transpiled/Halt.d.ts +72 -0
- package/transpiled/Halt.js +279 -0
- package/transpiled/Halt.js.map +1 -0
- package/transpiled/Reporter.d.ts +10 -0
- package/transpiled/Reporter.js +23 -7
- package/transpiled/Reporter.js.map +1 -1
- package/transpiled/index.d.ts +1 -1
- package/transpiled/model.d.ts +3 -10
- package/ui/dist/_app/immutable/assets/0.lZd8PDGB.css +2 -0
- package/ui/dist/_app/immutable/chunks/BYGx-tUu.js +6 -0
- package/ui/dist/_app/immutable/chunks/BmMhn2QK.js +1 -0
- package/ui/dist/_app/immutable/chunks/C7j91YQ-.js +6 -0
- package/ui/dist/_app/immutable/chunks/{DThuo_DL.js → CB6qHsyu.js} +1 -1
- package/ui/dist/_app/immutable/chunks/CBoY9kBO.js +2 -0
- package/ui/dist/_app/immutable/chunks/CMJYA4Le.js +1 -0
- package/ui/dist/_app/immutable/chunks/Cyx235dG.js +1 -0
- package/ui/dist/_app/immutable/chunks/DSlJ2Pi2.js +1 -0
- package/ui/dist/_app/immutable/chunks/K6eu_fpK.js +1 -0
- package/ui/dist/_app/immutable/chunks/X3sfW33Q.js +1 -0
- package/ui/dist/_app/immutable/chunks/sTot5bBi.js +3 -0
- package/ui/dist/_app/immutable/entry/app._nBtHSlX.js +2 -0
- package/ui/dist/_app/immutable/entry/start.BIK196Vd.js +1 -0
- package/ui/dist/_app/immutable/nodes/0.jrtR8xep.js +1 -0
- package/ui/dist/_app/immutable/nodes/1.DcxTn8Wv.js +1 -0
- package/ui/dist/_app/immutable/nodes/2.C0fg7g4t.js +8 -0
- package/ui/dist/_app/immutable/nodes/3.PPZqOKXF.js +1 -0
- package/ui/dist/_app/immutable/nodes/4.DtCrZa9O.js +1 -0
- package/ui/dist/_app/immutable/nodes/5.G5Augfai.js +1 -0
- package/ui/dist/_app/version.json +1 -1
- package/ui/dist/index.html +14 -14
- package/transpiled/sample.d.ts +0 -7
- package/transpiled/sample.js +0 -39
- package/transpiled/sample.js.map +0 -1
- package/ui/dist/_app/immutable/assets/0.DG1WW3yI.css +0 -2
- package/ui/dist/_app/immutable/chunks/B579biXu.js +0 -6
- package/ui/dist/_app/immutable/chunks/BReZMlNI.js +0 -1
- package/ui/dist/_app/immutable/chunks/BoCpTiWd.js +0 -6
- package/ui/dist/_app/immutable/chunks/CUh5ICfl.js +0 -1
- package/ui/dist/_app/immutable/chunks/DINmginf.js +0 -1
- package/ui/dist/_app/immutable/chunks/DjHzH_i6.js +0 -1
- package/ui/dist/_app/immutable/chunks/Dp5RKKpa.js +0 -1
- package/ui/dist/_app/immutable/chunks/PUjOYRcs.js +0 -3
- package/ui/dist/_app/immutable/chunks/h31w9qZ5.js +0 -1
- package/ui/dist/_app/immutable/chunks/sbIG1T-l.js +0 -2
- package/ui/dist/_app/immutable/entry/app.CaoYaGgS.js +0 -2
- package/ui/dist/_app/immutable/entry/start.TpSGge3Q.js +0 -1
- package/ui/dist/_app/immutable/nodes/0.BpUm4TlT.js +0 -1
- package/ui/dist/_app/immutable/nodes/1.CuJMJpT5.js +0 -1
- package/ui/dist/_app/immutable/nodes/2.gL71BcOi.js +0 -8
- package/ui/dist/_app/immutable/nodes/3.QQnSzfzp.js +0 -1
- package/ui/dist/_app/immutable/nodes/4.CyVgStp4.js +0 -1
- package/ui/dist/_app/immutable/nodes/5.D_wUPuR0.js +0 -1
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Connector } from '@toa.io/core';
|
|
2
|
+
import type { Options } from '@toa.io/definitions/extensions.introspection';
|
|
3
|
+
import type { Host } from './Factory.ts';
|
|
4
|
+
/**
|
|
5
|
+
* Hears a halt, takes the process quiet, and reads the map to find out whether the deployment
|
|
6
|
+
* went quiet with it.
|
|
7
|
+
*
|
|
8
|
+
* A signal is a record of `introspection.signals`, so what carries it is the event that
|
|
9
|
+
* component publishes on a committed write. The subscription takes no group, which is a queue
|
|
10
|
+
* of its own per process — so a signal written once reaches every process there is.
|
|
11
|
+
*
|
|
12
|
+
* **Any process may call the stop, and the rest obey without consulting their own view.**
|
|
13
|
+
* Seeing stillness is an assertion, acted on alone and binding on everyone; seeing activity is
|
|
14
|
+
* only an opinion, held quietly and given up if anyone asserts otherwise. Nothing has to be
|
|
15
|
+
* agreed, which is the point: `UPDATED` is one field overwritten in place, so no two processes
|
|
16
|
+
* reading the map read the same past, and a scheme that needed them to would need an atomic
|
|
17
|
+
* read point this has nowhere to take from.
|
|
18
|
+
*
|
|
19
|
+
* This sits behind a gate of its own, and so goes down with everything else. Nothing is
|
|
20
|
+
* listening while a halt lasts, which is what makes a halted process hold nothing open, and
|
|
21
|
+
* why a halt cannot be called off once it is down: it ends when the interval it carried is up,
|
|
22
|
+
* and by nothing else.
|
|
23
|
+
*/
|
|
24
|
+
export declare class Halt extends Connector {
|
|
25
|
+
private readonly host;
|
|
26
|
+
private readonly options;
|
|
27
|
+
private readonly remotes;
|
|
28
|
+
/** The halt this process is quiesced for, while it is. */
|
|
29
|
+
private pending;
|
|
30
|
+
private timer;
|
|
31
|
+
constructor(host: Host, options: Options);
|
|
32
|
+
protected open(): Promise<void>;
|
|
33
|
+
protected close(): Promise<void>;
|
|
34
|
+
private subscribe;
|
|
35
|
+
/**
|
|
36
|
+
* What arrives crosses the wire and outlives the release that wrote it, so every number is
|
|
37
|
+
* read as one and bounded here rather than trusted: the receiver is what has to come back.
|
|
38
|
+
*/
|
|
39
|
+
private signalled;
|
|
40
|
+
private begin;
|
|
41
|
+
private quiesce;
|
|
42
|
+
/**
|
|
43
|
+
* The window is over. What the map says now is what this process has to go on, and what it
|
|
44
|
+
* says is one thing: whether anything, anywhere in this region, was called since the signal.
|
|
45
|
+
*/
|
|
46
|
+
private decide;
|
|
47
|
+
/** No stop came. Nothing was closed, so nothing has to be built again. */
|
|
48
|
+
private give;
|
|
49
|
+
/** A stop is obeyed only while this process is quiesced for the halt it answers. */
|
|
50
|
+
private obey;
|
|
51
|
+
private down;
|
|
52
|
+
/**
|
|
53
|
+
* Whether nothing has been called in this region since the signal.
|
|
54
|
+
*
|
|
55
|
+
* The map is what the whole fleet writes, and a flush that observed nothing writes nothing —
|
|
56
|
+
* so a region with no edge newer than the signal is a region where nothing was called. It is
|
|
57
|
+
* read rather than voted on, and this process's own view of itself is not part of it: what a
|
|
58
|
+
* process is handling it has written no edge for yet, and a stop called while it was would
|
|
59
|
+
* still wait for it rather than interrupt it.
|
|
60
|
+
*
|
|
61
|
+
* Anything unanswered is activity. A process that cannot read the map does not stop the
|
|
62
|
+
* deployment on a guess.
|
|
63
|
+
*/
|
|
64
|
+
private still;
|
|
65
|
+
/** Writes the stop. It reaches every process as the halt did, this one included. */
|
|
66
|
+
private call;
|
|
67
|
+
private later;
|
|
68
|
+
private disarm;
|
|
69
|
+
/** Runs in the background: discovery waits for the explorer as long as it takes. */
|
|
70
|
+
private acquire;
|
|
71
|
+
private reach;
|
|
72
|
+
}
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import { Connector, Locator } from '@toa.io/core';
|
|
2
|
+
import { console } from 'openspan';
|
|
3
|
+
import { environment, timeout } from '@toa.io/generic';
|
|
4
|
+
import { CHECK_TIMEOUT, DEFAULT_GRACE, EDGES, GRACE, HALT_GAP, NAMESPACE, SIGNAL, SIGNALS } from '@toa.io/definitions/extensions.introspection';
|
|
5
|
+
/**
|
|
6
|
+
* Hears a halt, takes the process quiet, and reads the map to find out whether the deployment
|
|
7
|
+
* went quiet with it.
|
|
8
|
+
*
|
|
9
|
+
* A signal is a record of `introspection.signals`, so what carries it is the event that
|
|
10
|
+
* component publishes on a committed write. The subscription takes no group, which is a queue
|
|
11
|
+
* of its own per process — so a signal written once reaches every process there is.
|
|
12
|
+
*
|
|
13
|
+
* **Any process may call the stop, and the rest obey without consulting their own view.**
|
|
14
|
+
* Seeing stillness is an assertion, acted on alone and binding on everyone; seeing activity is
|
|
15
|
+
* only an opinion, held quietly and given up if anyone asserts otherwise. Nothing has to be
|
|
16
|
+
* agreed, which is the point: `UPDATED` is one field overwritten in place, so no two processes
|
|
17
|
+
* reading the map read the same past, and a scheme that needed them to would need an atomic
|
|
18
|
+
* read point this has nowhere to take from.
|
|
19
|
+
*
|
|
20
|
+
* This sits behind a gate of its own, and so goes down with everything else. Nothing is
|
|
21
|
+
* listening while a halt lasts, which is what makes a halted process hold nothing open, and
|
|
22
|
+
* why a halt cannot be called off once it is down: it ends when the interval it carried is up,
|
|
23
|
+
* and by nothing else.
|
|
24
|
+
*/
|
|
25
|
+
export class Halt extends Connector {
|
|
26
|
+
host;
|
|
27
|
+
options;
|
|
28
|
+
remotes = {};
|
|
29
|
+
/** The halt this process is quiesced for, while it is. */
|
|
30
|
+
pending = null;
|
|
31
|
+
timer = null;
|
|
32
|
+
constructor(host, options) {
|
|
33
|
+
super();
|
|
34
|
+
this.host = host;
|
|
35
|
+
this.options = options;
|
|
36
|
+
}
|
|
37
|
+
async open() {
|
|
38
|
+
/*
|
|
39
|
+
* Deliberately not awaited. Reaching the component is a discovery, which waits as long as
|
|
40
|
+
* it takes, and in the explorer process the component being looked up is one this same
|
|
41
|
+
* process is still starting. A halt is not worth holding a boot for.
|
|
42
|
+
*/
|
|
43
|
+
void this.subscribe().catch((error) => {
|
|
44
|
+
console.error('Introspection cannot subscribe to signals', {
|
|
45
|
+
message: error.message
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
async close() {
|
|
50
|
+
this.disarm();
|
|
51
|
+
this.pending = null;
|
|
52
|
+
}
|
|
53
|
+
async subscribe() {
|
|
54
|
+
const consumer = await this.host.receive(SIGNAL, new Subscription(this.signalled.bind(this)));
|
|
55
|
+
this.depends(consumer);
|
|
56
|
+
await consumer.connect();
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* What arrives crosses the wire and outlives the release that wrote it, so every number is
|
|
60
|
+
* read as one and bounded here rather than trusted: the receiver is what has to come back.
|
|
61
|
+
*/
|
|
62
|
+
signalled(signal) {
|
|
63
|
+
if (signal?.type === 'halt')
|
|
64
|
+
this.begin(signal);
|
|
65
|
+
if (signal?.type === 'stop')
|
|
66
|
+
this.obey(signal);
|
|
67
|
+
}
|
|
68
|
+
begin(signal) {
|
|
69
|
+
// one at a time: a process quiesced for a halt is deaf to another, and to a redelivery
|
|
70
|
+
if (this.pending !== null || typeof signal.id !== 'string')
|
|
71
|
+
return;
|
|
72
|
+
const seconds = bound(signal.seconds, this.options.duration);
|
|
73
|
+
const quiescence = bound(signal.quiescence, this.options.quiescence);
|
|
74
|
+
const grace = bound(signal.grace, GRACE, DEFAULT_GRACE);
|
|
75
|
+
if (seconds === null || quiescence === null || grace === null)
|
|
76
|
+
return;
|
|
77
|
+
/*
|
|
78
|
+
* The map is read against the moment the signal was written, not the moment this process
|
|
79
|
+
* received it: `CREATED` and an edge's `UPDATED` are both written by the components of
|
|
80
|
+
* this extension, so they are one clock, and what this process's clock says about either
|
|
81
|
+
* is beside the point.
|
|
82
|
+
*/
|
|
83
|
+
const since = typeof signal.CREATED === 'number' ? signal.CREATED : Date.now();
|
|
84
|
+
this.pending = { id: signal.id, seconds, quiescence, grace, since };
|
|
85
|
+
console.warn('Halt signalled, going quiet', { seconds, quiescence });
|
|
86
|
+
// the caller is a consumer callback, and this goes on to wait out a window under it
|
|
87
|
+
void this.quiesce(quiescence);
|
|
88
|
+
}
|
|
89
|
+
async quiesce(quiescence) {
|
|
90
|
+
// in the background, so that the map is reachable by the time there is a decision to make
|
|
91
|
+
this.acquire();
|
|
92
|
+
try {
|
|
93
|
+
await this.host.quiesce();
|
|
94
|
+
}
|
|
95
|
+
finally {
|
|
96
|
+
// whatever the quiesce did, there is a decision owed: one never taken is a process
|
|
97
|
+
// that is quiet for good
|
|
98
|
+
this.later(quiescence + HALT_GAP, () => void this.decide());
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* The window is over. What the map says now is what this process has to go on, and what it
|
|
103
|
+
* says is one thing: whether anything, anywhere in this region, was called since the signal.
|
|
104
|
+
*/
|
|
105
|
+
async decide() {
|
|
106
|
+
const pending = this.pending;
|
|
107
|
+
if (pending === null)
|
|
108
|
+
return;
|
|
109
|
+
const still = await this.still(pending.since);
|
|
110
|
+
// someone else's stop may have landed while the map was being read
|
|
111
|
+
if (this.pending !== pending)
|
|
112
|
+
return;
|
|
113
|
+
if (still) {
|
|
114
|
+
console.warn('The deployment is still, calling the stop');
|
|
115
|
+
// written first, because what stops every other process is the record and not this one
|
|
116
|
+
if (await this.call(pending)) {
|
|
117
|
+
this.down(pending.seconds);
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
/*
|
|
122
|
+
* Someone is always last to catch on. This process has concluded, and what it does now is
|
|
123
|
+
* wait for someone else's conclusion — listening, not looking again. It leaves the halt
|
|
124
|
+
* only if no stop arrives, and the guard covers the other order: one that has left ignores
|
|
125
|
+
* a stop that lands after.
|
|
126
|
+
*/
|
|
127
|
+
console.warn('The deployment is working, waiting for another opinion', {
|
|
128
|
+
grace: pending.grace
|
|
129
|
+
});
|
|
130
|
+
this.later(pending.grace, () => void this.give());
|
|
131
|
+
}
|
|
132
|
+
/** No stop came. Nothing was closed, so nothing has to be built again. */
|
|
133
|
+
async give() {
|
|
134
|
+
if (this.pending === null)
|
|
135
|
+
return;
|
|
136
|
+
this.pending = null;
|
|
137
|
+
console.warn('Halt cancelled, this process is working');
|
|
138
|
+
await this.host.cancel();
|
|
139
|
+
}
|
|
140
|
+
/** A stop is obeyed only while this process is quiesced for the halt it answers. */
|
|
141
|
+
obey(signal) {
|
|
142
|
+
const pending = this.pending;
|
|
143
|
+
if (pending === null || signal.signal !== pending.id)
|
|
144
|
+
return;
|
|
145
|
+
this.down(pending.seconds);
|
|
146
|
+
}
|
|
147
|
+
down(seconds) {
|
|
148
|
+
this.disarm();
|
|
149
|
+
this.pending = null;
|
|
150
|
+
this.host.stop(seconds);
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Whether nothing has been called in this region since the signal.
|
|
154
|
+
*
|
|
155
|
+
* The map is what the whole fleet writes, and a flush that observed nothing writes nothing —
|
|
156
|
+
* so a region with no edge newer than the signal is a region where nothing was called. It is
|
|
157
|
+
* read rather than voted on, and this process's own view of itself is not part of it: what a
|
|
158
|
+
* process is handling it has written no edge for yet, and a stop called while it was would
|
|
159
|
+
* still wait for it rather than interrupt it.
|
|
160
|
+
*
|
|
161
|
+
* Anything unanswered is activity. A process that cannot read the map does not stop the
|
|
162
|
+
* deployment on a guess.
|
|
163
|
+
*/
|
|
164
|
+
async still(since) {
|
|
165
|
+
const edges = this.remotes[EDGES];
|
|
166
|
+
if (edges === undefined)
|
|
167
|
+
return false;
|
|
168
|
+
const criteria = `UPDATED>${since};REGION==${REGION}`;
|
|
169
|
+
try {
|
|
170
|
+
const reply = await race(edges.invoke('enumerate', { query: { criteria, limit: 1 } }));
|
|
171
|
+
const rows = Array.isArray(reply) ? reply : reply?.output;
|
|
172
|
+
if (!Array.isArray(rows)) {
|
|
173
|
+
console.warn('The map answered something else', { reply });
|
|
174
|
+
return false;
|
|
175
|
+
}
|
|
176
|
+
return rows.length === 0;
|
|
177
|
+
}
|
|
178
|
+
catch (error) {
|
|
179
|
+
console.error('The map could not be read', { message: error.message });
|
|
180
|
+
return false;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
/** Writes the stop. It reaches every process as the halt did, this one included. */
|
|
184
|
+
async call(pending) {
|
|
185
|
+
const signals = this.remotes[SIGNALS];
|
|
186
|
+
if (signals === undefined)
|
|
187
|
+
return false;
|
|
188
|
+
try {
|
|
189
|
+
const reply = await race(signals.invoke('create', {
|
|
190
|
+
input: {
|
|
191
|
+
type: 'stop',
|
|
192
|
+
seconds: pending.seconds,
|
|
193
|
+
// what the halt asked for, because a record says what it was answering
|
|
194
|
+
quiescence: pending.quiescence,
|
|
195
|
+
signal: pending.id
|
|
196
|
+
}
|
|
197
|
+
}));
|
|
198
|
+
if (reply?.error !== undefined || reply?.exception !== undefined) {
|
|
199
|
+
console.error('The stop was refused', { reply });
|
|
200
|
+
return false;
|
|
201
|
+
}
|
|
202
|
+
return true;
|
|
203
|
+
}
|
|
204
|
+
catch (error) {
|
|
205
|
+
console.error('The stop could not be written', {
|
|
206
|
+
message: error.message
|
|
207
|
+
});
|
|
208
|
+
return false;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
later(seconds, fn) {
|
|
212
|
+
this.disarm();
|
|
213
|
+
this.timer = setTimeout(fn, seconds * 1000);
|
|
214
|
+
this.timer.unref();
|
|
215
|
+
}
|
|
216
|
+
disarm() {
|
|
217
|
+
if (this.timer === null)
|
|
218
|
+
return;
|
|
219
|
+
clearTimeout(this.timer);
|
|
220
|
+
this.timer = null;
|
|
221
|
+
}
|
|
222
|
+
/** Runs in the background: discovery waits for the explorer as long as it takes. */
|
|
223
|
+
acquire() {
|
|
224
|
+
for (const name of [EDGES, SIGNALS]) {
|
|
225
|
+
if (name in this.remotes)
|
|
226
|
+
continue;
|
|
227
|
+
void this.reach(name).catch((error) => {
|
|
228
|
+
console.error('Introspection cannot reach its explorer', {
|
|
229
|
+
message: error.message
|
|
230
|
+
});
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
async reach(name) {
|
|
235
|
+
const remote = await this.host.remote(new Locator(name, NAMESPACE));
|
|
236
|
+
this.depends(remote);
|
|
237
|
+
await remote.connect();
|
|
238
|
+
this.remotes[name] = remote;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
/** What a binding hands a message to; the connector's lifecycle is not the handler's. */
|
|
242
|
+
class Subscription extends Connector {
|
|
243
|
+
handler;
|
|
244
|
+
constructor(handler) {
|
|
245
|
+
super();
|
|
246
|
+
this.handler = handler;
|
|
247
|
+
}
|
|
248
|
+
async receive(message) {
|
|
249
|
+
this.handler(message.payload);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
/** A number as it came, within what this release accepts, or `null` where it is not one. */
|
|
253
|
+
function bound(value, [min, max], fallback) {
|
|
254
|
+
if (value === undefined && fallback !== undefined)
|
|
255
|
+
return fallback;
|
|
256
|
+
if (typeof value !== 'number' || !Number.isFinite(value))
|
|
257
|
+
return null;
|
|
258
|
+
return Math.min(max, Math.max(min, Math.round(value)));
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* A quiesced process that waits for an answer that never comes is a process that never comes
|
|
262
|
+
* back, so every call a decision rests on is given a deadline.
|
|
263
|
+
*
|
|
264
|
+
* What runs out of it is a failure and not an answer: a stop whose write went unacknowledged
|
|
265
|
+
* may never have been written, and a process that took it for one would go down alone.
|
|
266
|
+
*/
|
|
267
|
+
async function race(call) {
|
|
268
|
+
const reply = await Promise.race([
|
|
269
|
+
call,
|
|
270
|
+
timeout(CHECK_TIMEOUT).then(() => UNANSWERED)
|
|
271
|
+
]);
|
|
272
|
+
if (reply === UNANSWERED)
|
|
273
|
+
throw new Error(`it was not answered within ${CHECK_TIMEOUT}ms`);
|
|
274
|
+
return reply;
|
|
275
|
+
}
|
|
276
|
+
const UNANSWERED = Symbol('unanswered');
|
|
277
|
+
/** The region this deployment is, which is the only one its map answers for. */
|
|
278
|
+
const REGION = Number(environment.get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MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAA"}
|
package/transpiled/Reporter.d.ts
CHANGED
|
@@ -28,7 +28,17 @@ export declare class Reporter extends Connector {
|
|
|
28
28
|
/** A call between two components. */
|
|
29
29
|
observe(observed: Edge): void;
|
|
30
30
|
protected open(): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* A quiesced process flushes every second instead of on its configured period, because what
|
|
33
|
+
* it observed last is the evidence a halt is decided on and the decision is seconds away.
|
|
34
|
+
*
|
|
35
|
+
* It costs nothing: nothing is calling anything, so every flush but the first finds an empty
|
|
36
|
+
* buffer and returns without a call.
|
|
37
|
+
*/
|
|
38
|
+
protected pause(): void;
|
|
39
|
+
protected unpause(): void;
|
|
31
40
|
protected close(): Promise<void>;
|
|
41
|
+
private every;
|
|
32
42
|
private ready;
|
|
33
43
|
private flush;
|
|
34
44
|
private discard;
|
package/transpiled/Reporter.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Connector, Locator } from '@toa.io/core';
|
|
2
2
|
import { console } from 'openspan';
|
|
3
|
-
import { EDGES, MAX_EDGES, NAMESPACE, NODES } from '@toa.io/definitions/extensions.introspection';
|
|
3
|
+
import { EDGES, MAX_EDGES, NAMESPACE, NODES, QUIESCE_INTERVAL } from '@toa.io/definitions/extensions.introspection';
|
|
4
4
|
import * as keys from './keys.js';
|
|
5
5
|
/**
|
|
6
6
|
* Buffers what a process observes and flushes it into the introspection
|
|
@@ -35,8 +35,7 @@ export class Reporter extends Connector {
|
|
|
35
35
|
/** A call between two components. */
|
|
36
36
|
observe(observed) {
|
|
37
37
|
const id = keys.edge(observed.src, observed.dst);
|
|
38
|
-
|
|
39
|
-
if (edge === undefined) {
|
|
38
|
+
if (!this.edges.has(id)) {
|
|
40
39
|
/*
|
|
41
40
|
* `source` arrives over the wire, so the number of distinct edges a process
|
|
42
41
|
* can hold has to be bounded regardless of what peers send — and of whether
|
|
@@ -48,16 +47,27 @@ export class Reporter extends Connector {
|
|
|
48
47
|
}
|
|
49
48
|
this.edges.set(id, observed);
|
|
50
49
|
}
|
|
51
|
-
else if (observed.sample !== undefined)
|
|
52
|
-
edge.sample = observed.sample;
|
|
53
50
|
if (this.edges.size >= this.options.threshold)
|
|
54
51
|
void this.flush();
|
|
55
52
|
}
|
|
56
53
|
async open() {
|
|
57
54
|
// deliberately not awaited: the explorer may not be there yet, or at all
|
|
58
55
|
this.acquire();
|
|
59
|
-
this.
|
|
60
|
-
|
|
56
|
+
this.every(this.options.interval);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* A quiesced process flushes every second instead of on its configured period, because what
|
|
60
|
+
* it observed last is the evidence a halt is decided on and the decision is seconds away.
|
|
61
|
+
*
|
|
62
|
+
* It costs nothing: nothing is calling anything, so every flush but the first finds an empty
|
|
63
|
+
* buffer and returns without a call.
|
|
64
|
+
*/
|
|
65
|
+
pause() {
|
|
66
|
+
this.every(QUIESCE_INTERVAL);
|
|
67
|
+
void this.flush();
|
|
68
|
+
}
|
|
69
|
+
unpause() {
|
|
70
|
+
this.every(this.options.interval);
|
|
61
71
|
}
|
|
62
72
|
async close() {
|
|
63
73
|
if (this.timer !== null) {
|
|
@@ -74,6 +84,12 @@ export class Reporter extends Connector {
|
|
|
74
84
|
console.debug('Introspection final flush failed', { message: error.message });
|
|
75
85
|
});
|
|
76
86
|
}
|
|
87
|
+
every(seconds) {
|
|
88
|
+
if (this.timer !== null)
|
|
89
|
+
clearInterval(this.timer);
|
|
90
|
+
this.timer = setInterval(() => void this.flush(), seconds * 1000);
|
|
91
|
+
this.timer.unref();
|
|
92
|
+
}
|
|
77
93
|
ready() {
|
|
78
94
|
return NODES in this.remotes && EDGES in this.remotes;
|
|
79
95
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Reporter.js","sourceRoot":"","sources":["../source/Reporter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,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AC,KAAK;QACjB,MAAM,OAAO,CAAC,GAAG,CACf,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;YAChC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAA;YAEnE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;YAEpB,MAAM,MAAM,CAAC,OAAO,EAAE,CAAA;YAEtB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,CAAA;QAC7B,CAAC,CAAC,CACH,CAAA;IACH,CAAC;CACF"}
|
package/transpiled/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { Factory } from './Factory.ts';
|
|
2
2
|
export { components } from './Composition.ts';
|
|
3
|
-
export type { Annotation, Declaration, Options
|
|
3
|
+
export type { Annotation, Declaration, Options } from '@toa.io/definitions/extensions.introspection';
|
|
4
4
|
export type * from './model.ts';
|
package/transpiled/model.d.ts
CHANGED
|
@@ -52,21 +52,14 @@ export interface Node {
|
|
|
52
52
|
receivers: Receiver[];
|
|
53
53
|
extensions: string[];
|
|
54
54
|
}
|
|
55
|
-
export interface Sample {
|
|
56
|
-
at: number;
|
|
57
|
-
input?: unknown;
|
|
58
|
-
outcome: Outcome;
|
|
59
|
-
}
|
|
60
|
-
export type Outcome = 'ok' | 'error' | 'exception';
|
|
61
55
|
/**
|
|
62
|
-
* A call observed in a process between flushes
|
|
63
|
-
*
|
|
64
|
-
* an edge is what actually happened.
|
|
56
|
+
* A call observed in a process between flushes: that it was made, and between whom —
|
|
57
|
+
* never what it carried. What the application declares — which events exist, and which
|
|
58
|
+
* receiver takes which — is a node's business; an edge is what actually happened.
|
|
65
59
|
*
|
|
66
60
|
* Sent to `introspection.edges`.
|
|
67
61
|
*/
|
|
68
62
|
export interface Edge {
|
|
69
63
|
src: Origin;
|
|
70
64
|
dst: Target;
|
|
71
|
-
sample?: Sample;
|
|
72
65
|
}
|