@flowrensic/node 0.6.20 → 0.6.21
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 -2
- package/dist/cjs/client-interceptor.d.ts +19 -8
- package/dist/cjs/client-interceptor.d.ts.map +1 -1
- package/dist/cjs/client-interceptor.js +47 -23
- package/dist/cjs/client-interceptor.js.map +1 -1
- package/dist/cjs/client.d.ts +3 -1
- package/dist/cjs/client.d.ts.map +1 -1
- package/dist/cjs/client.js +2 -0
- package/dist/cjs/client.js.map +1 -1
- package/dist/cjs/gen/flowrensic/v1/client_calls_pb.d.ts +87 -3
- package/dist/cjs/gen/flowrensic/v1/client_calls_pb.d.ts.map +1 -1
- package/dist/cjs/gen/flowrensic/v1/client_calls_pb.js +17 -2
- package/dist/cjs/gen/flowrensic/v1/client_calls_pb.js.map +1 -1
- package/dist/cjs/gen/flowrensic/v1/remediation_pb.d.ts +317 -0
- package/dist/cjs/gen/flowrensic/v1/remediation_pb.d.ts.map +1 -0
- package/dist/cjs/gen/flowrensic/v1/remediation_pb.js +97 -0
- package/dist/cjs/gen/flowrensic/v1/remediation_pb.js.map +1 -0
- package/dist/cjs/gen/flowrensic/v1/replay_pb.d.ts +94 -0
- package/dist/cjs/gen/flowrensic/v1/replay_pb.d.ts.map +1 -1
- package/dist/cjs/gen/flowrensic/v1/replay_pb.js +17 -2
- package/dist/cjs/gen/flowrensic/v1/replay_pb.js.map +1 -1
- package/dist/cjs/gen/flowrensic/v1/reset_pb.d.ts +154 -0
- package/dist/cjs/gen/flowrensic/v1/reset_pb.d.ts.map +1 -0
- package/dist/cjs/gen/flowrensic/v1/reset_pb.js +78 -0
- package/dist/cjs/gen/flowrensic/v1/reset_pb.js.map +1 -0
- package/dist/cjs/gen/flowrensic/v1/services_pb.d.ts +100 -2
- package/dist/cjs/gen/flowrensic/v1/services_pb.d.ts.map +1 -1
- package/dist/cjs/gen/flowrensic/v1/services_pb.js +19 -2
- package/dist/cjs/gen/flowrensic/v1/services_pb.js.map +1 -1
- package/dist/cjs/gen/flowrensic/v1/workflow_types_pb.d.ts +279 -0
- package/dist/cjs/gen/flowrensic/v1/workflow_types_pb.d.ts.map +1 -0
- package/dist/cjs/gen/flowrensic/v1/workflow_types_pb.js +50 -0
- package/dist/cjs/gen/flowrensic/v1/workflow_types_pb.js.map +1 -0
- package/dist/cjs/index.d.ts +8 -2
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +7 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/query-sink.d.ts +33 -0
- package/dist/cjs/query-sink.d.ts.map +1 -0
- package/dist/cjs/query-sink.js +59 -0
- package/dist/cjs/query-sink.js.map +1 -0
- package/dist/cjs/sink.d.ts +26 -11
- package/dist/cjs/sink.d.ts.map +1 -1
- package/dist/cjs/sink.js +87 -32
- package/dist/cjs/sink.js.map +1 -1
- package/dist/cjs/workflow.d.ts +11 -0
- package/dist/cjs/workflow.d.ts.map +1 -0
- package/dist/cjs/workflow.js +25 -0
- package/dist/cjs/workflow.js.map +1 -0
- package/dist/esm/client-interceptor.d.ts +19 -8
- package/dist/esm/client-interceptor.d.ts.map +1 -1
- package/dist/esm/client-interceptor.js +47 -23
- package/dist/esm/client-interceptor.js.map +1 -1
- package/dist/esm/client.d.ts +3 -1
- package/dist/esm/client.d.ts.map +1 -1
- package/dist/esm/client.js +3 -1
- package/dist/esm/client.js.map +1 -1
- package/dist/esm/gen/flowrensic/v1/client_calls_pb.d.ts +87 -3
- package/dist/esm/gen/flowrensic/v1/client_calls_pb.d.ts.map +1 -1
- package/dist/esm/gen/flowrensic/v1/client_calls_pb.js +16 -1
- package/dist/esm/gen/flowrensic/v1/client_calls_pb.js.map +1 -1
- package/dist/esm/gen/flowrensic/v1/remediation_pb.d.ts +317 -0
- package/dist/esm/gen/flowrensic/v1/remediation_pb.d.ts.map +1 -0
- package/dist/esm/gen/flowrensic/v1/remediation_pb.js +94 -0
- package/dist/esm/gen/flowrensic/v1/remediation_pb.js.map +1 -0
- package/dist/esm/gen/flowrensic/v1/replay_pb.d.ts +94 -0
- package/dist/esm/gen/flowrensic/v1/replay_pb.d.ts.map +1 -1
- package/dist/esm/gen/flowrensic/v1/replay_pb.js +16 -1
- package/dist/esm/gen/flowrensic/v1/replay_pb.js.map +1 -1
- package/dist/esm/gen/flowrensic/v1/reset_pb.d.ts +154 -0
- package/dist/esm/gen/flowrensic/v1/reset_pb.d.ts.map +1 -0
- package/dist/esm/gen/flowrensic/v1/reset_pb.js +75 -0
- package/dist/esm/gen/flowrensic/v1/reset_pb.js.map +1 -0
- package/dist/esm/gen/flowrensic/v1/services_pb.d.ts +100 -2
- package/dist/esm/gen/flowrensic/v1/services_pb.d.ts.map +1 -1
- package/dist/esm/gen/flowrensic/v1/services_pb.js +18 -1
- package/dist/esm/gen/flowrensic/v1/services_pb.js.map +1 -1
- package/dist/esm/gen/flowrensic/v1/workflow_types_pb.d.ts +279 -0
- package/dist/esm/gen/flowrensic/v1/workflow_types_pb.d.ts.map +1 -0
- package/dist/esm/gen/flowrensic/v1/workflow_types_pb.js +47 -0
- package/dist/esm/gen/flowrensic/v1/workflow_types_pb.js.map +1 -0
- package/dist/esm/index.d.ts +8 -2
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/query-sink.d.ts +33 -0
- package/dist/esm/query-sink.d.ts.map +1 -0
- package/dist/esm/query-sink.js +56 -0
- package/dist/esm/query-sink.js.map +1 -0
- package/dist/esm/sink.d.ts +26 -11
- package/dist/esm/sink.d.ts.map +1 -1
- package/dist/esm/sink.js +86 -32
- package/dist/esm/sink.js.map +1 -1
- package/dist/esm/workflow.d.ts +11 -0
- package/dist/esm/workflow.d.ts.map +1 -0
- package/dist/esm/workflow.js +21 -0
- package/dist/esm/workflow.js.map +1 -0
- package/package.json +15 -3
package/dist/cjs/sink.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createRecordBuffer = createRecordBuffer;
|
|
3
4
|
exports.createAttemptSink = createAttemptSink;
|
|
4
5
|
const node_os_1 = require("node:os");
|
|
5
6
|
const connect_1 = require("@connectrpc/connect");
|
|
@@ -13,15 +14,15 @@ function add(counts, env, n) {
|
|
|
13
14
|
else
|
|
14
15
|
counts.set(env, now);
|
|
15
16
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
// The waiting
|
|
17
|
+
/** True when Flowrensic did not answer or answered try again later, so the batch is sent again. */
|
|
18
|
+
function sendAgain(error) {
|
|
19
|
+
if (!(error instanceof connect_1.ConnectError))
|
|
20
|
+
return false;
|
|
21
|
+
return error.code === connect_1.Code.Unavailable || error.code === connect_1.Code.DeadlineExceeded || error.code === connect_1.Code.ResourceExhausted;
|
|
22
|
+
}
|
|
23
|
+
function createRecordBuffer(target, options = {}) {
|
|
24
|
+
const { batchSize = 64, flushIntervalMs = 1000, sendTimeoutMs = 5000, maxWaiting = 10_000, maxBatchSize = 500, } = options;
|
|
25
|
+
// The waiting records, oldest first, from head on.
|
|
25
26
|
let queue = [];
|
|
26
27
|
let head = 0;
|
|
27
28
|
const waitingByEnv = new Map();
|
|
@@ -35,6 +36,9 @@ function createAttemptSink(options) {
|
|
|
35
36
|
let sending;
|
|
36
37
|
let reporting;
|
|
37
38
|
let scheduled = false;
|
|
39
|
+
// Set while the last send went back to waiting. Until a send is answered,
|
|
40
|
+
// only the tick starts one.
|
|
41
|
+
let failing = false;
|
|
38
42
|
const waitingCount = () => queue.length - head;
|
|
39
43
|
const drop = (env, n) => {
|
|
40
44
|
add(dropped, env, n);
|
|
@@ -48,7 +52,7 @@ function createAttemptSink(options) {
|
|
|
48
52
|
head += 1;
|
|
49
53
|
if (one === undefined)
|
|
50
54
|
continue;
|
|
51
|
-
add(waitingByEnv, one
|
|
55
|
+
add(waitingByEnv, target.envOf(one), -1);
|
|
52
56
|
out.push(one);
|
|
53
57
|
}
|
|
54
58
|
return out;
|
|
@@ -61,37 +65,61 @@ function createAttemptSink(options) {
|
|
|
61
65
|
head = 0;
|
|
62
66
|
}
|
|
63
67
|
};
|
|
64
|
-
|
|
65
|
-
|
|
68
|
+
const dropOldest = () => {
|
|
69
|
+
const excess = waitingCount() - maxWaiting;
|
|
70
|
+
if (excess <= 0)
|
|
71
|
+
return;
|
|
72
|
+
for (const one of take(excess))
|
|
73
|
+
drop(target.envOf(one), 1);
|
|
74
|
+
};
|
|
75
|
+
// A batch with no answer goes back in front of the waiting records, oldest
|
|
76
|
+
// first.
|
|
77
|
+
const putBack = (records) => {
|
|
78
|
+
queue = [...records, ...queue.slice(head)];
|
|
79
|
+
head = 0;
|
|
80
|
+
for (const one of records)
|
|
81
|
+
add(waitingByEnv, target.envOf(one), 1);
|
|
82
|
+
dropOldest();
|
|
83
|
+
};
|
|
84
|
+
// One send at a time. Once it is answered the next starts right away while
|
|
85
|
+
// records wait. A send with no answer, or answered try again later, goes
|
|
86
|
+
// back and is tried again at the next tick. A send refused for any other
|
|
87
|
+
// reason is dropped.
|
|
66
88
|
const startSend = () => {
|
|
67
89
|
if (sending !== undefined || waitingCount() === 0)
|
|
68
90
|
return;
|
|
69
|
-
const
|
|
91
|
+
const records = take(Math.min(maxBatchSize, waitingCount()));
|
|
70
92
|
compact();
|
|
71
93
|
sending = (async () => {
|
|
72
94
|
try {
|
|
73
|
-
await
|
|
95
|
+
await target.send(records, sendTimeoutMs);
|
|
96
|
+
failing = false;
|
|
74
97
|
}
|
|
75
98
|
catch (error) {
|
|
76
|
-
const envs = new Set();
|
|
77
|
-
for (const one of events) {
|
|
78
|
-
drop(one.env, 1);
|
|
79
|
-
envs.add(one.env);
|
|
80
|
-
}
|
|
99
|
+
const envs = new Set(records.map((one) => target.envOf(one)));
|
|
81
100
|
if (error instanceof connect_1.ConnectError && error.code === connect_1.Code.DeadlineExceeded) {
|
|
82
101
|
for (const env of envs)
|
|
83
102
|
add(timedOut, env, 1);
|
|
84
103
|
timedOutTotal += 1;
|
|
85
104
|
}
|
|
105
|
+
if (sendAgain(error)) {
|
|
106
|
+
failing = true;
|
|
107
|
+
putBack(records);
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
for (const one of records)
|
|
111
|
+
drop(target.envOf(one), 1);
|
|
112
|
+
}
|
|
86
113
|
}
|
|
87
114
|
finally {
|
|
88
115
|
sending = undefined;
|
|
89
|
-
|
|
116
|
+
if (!failing)
|
|
117
|
+
startSend();
|
|
90
118
|
}
|
|
91
119
|
})();
|
|
92
120
|
};
|
|
93
121
|
const schedule = () => {
|
|
94
|
-
if (scheduled || sending !== undefined)
|
|
122
|
+
if (scheduled || failing || sending !== undefined)
|
|
95
123
|
return;
|
|
96
124
|
scheduled = true;
|
|
97
125
|
setImmediate(() => {
|
|
@@ -102,7 +130,8 @@ function createAttemptSink(options) {
|
|
|
102
130
|
// At most one report at a time, and only when a count changed since the
|
|
103
131
|
// last report that was answered.
|
|
104
132
|
const report = () => {
|
|
105
|
-
|
|
133
|
+
const sendReport = target.report?.bind(target);
|
|
134
|
+
if (sendReport === undefined || reporting !== undefined)
|
|
106
135
|
return;
|
|
107
136
|
const envs = new Set([...dropped.keys(), ...timedOut.keys(), ...waitingByEnv.keys(), ...reportedWaiting.keys()]);
|
|
108
137
|
const changed = [...envs].some((env) => dropped.has(env) || timedOut.has(env) || (waitingByEnv.get(env) ?? 0) !== (reportedWaiting.get(env) ?? 0));
|
|
@@ -120,7 +149,7 @@ function createAttemptSink(options) {
|
|
|
120
149
|
}));
|
|
121
150
|
reporting = (async () => {
|
|
122
151
|
try {
|
|
123
|
-
await
|
|
152
|
+
await sendReport(reports, sendTimeoutMs);
|
|
124
153
|
for (const [env, n] of sentDropped)
|
|
125
154
|
add(dropped, env, -n);
|
|
126
155
|
for (const [env, n] of sentTimedOut)
|
|
@@ -140,12 +169,18 @@ function createAttemptSink(options) {
|
|
|
140
169
|
report();
|
|
141
170
|
}, flushIntervalMs);
|
|
142
171
|
timer.unref();
|
|
172
|
+
// Sends what waits. A send that goes back ends it, after one more try when
|
|
173
|
+
// the sends were already going back.
|
|
143
174
|
const flush = async () => {
|
|
175
|
+
let tried = false;
|
|
144
176
|
for (;;) {
|
|
145
177
|
if (sending !== undefined)
|
|
146
178
|
await sending;
|
|
147
|
-
else if (waitingCount() > 0)
|
|
179
|
+
else if (waitingCount() > 0 && (!failing || !tried)) {
|
|
180
|
+
tried = true;
|
|
181
|
+
failing = false;
|
|
148
182
|
startSend();
|
|
183
|
+
}
|
|
149
184
|
else
|
|
150
185
|
break;
|
|
151
186
|
}
|
|
@@ -156,14 +191,10 @@ function createAttemptSink(options) {
|
|
|
156
191
|
await reporting;
|
|
157
192
|
};
|
|
158
193
|
return {
|
|
159
|
-
record(
|
|
160
|
-
queue.push(
|
|
161
|
-
add(waitingByEnv,
|
|
162
|
-
|
|
163
|
-
const [oldest] = take(1);
|
|
164
|
-
if (oldest !== undefined)
|
|
165
|
-
drop(oldest.env, 1);
|
|
166
|
-
}
|
|
194
|
+
record(one) {
|
|
195
|
+
queue.push(one);
|
|
196
|
+
add(waitingByEnv, target.envOf(one), 1);
|
|
197
|
+
dropOldest();
|
|
167
198
|
if (waitingCount() >= batchSize)
|
|
168
199
|
schedule();
|
|
169
200
|
},
|
|
@@ -171,10 +202,34 @@ function createAttemptSink(options) {
|
|
|
171
202
|
async close() {
|
|
172
203
|
clearInterval(timer);
|
|
173
204
|
await flush();
|
|
205
|
+
// What still waits will not be sent.
|
|
206
|
+
for (const one of take(waitingCount()))
|
|
207
|
+
drop(target.envOf(one), 1);
|
|
208
|
+
compact();
|
|
209
|
+
report();
|
|
210
|
+
if (reporting !== undefined)
|
|
211
|
+
await reporting;
|
|
174
212
|
},
|
|
175
213
|
counts() {
|
|
176
214
|
return { dropped: droppedTotal, timedOut: timedOutTotal, waiting: waitingCount() };
|
|
177
215
|
},
|
|
178
216
|
};
|
|
179
217
|
}
|
|
218
|
+
function createAttemptSink(options) {
|
|
219
|
+
const workerId = options.workerId ?? `${(0, node_os_1.hostname)()}-${String(process.pid)}`;
|
|
220
|
+
const ingest = (0, connect_1.createClient)(services_pb_js_1.IngestService, (0, connect_node_1.createConnectTransport)({
|
|
221
|
+
baseUrl: options.baseUrl,
|
|
222
|
+
httpVersion: '1.1',
|
|
223
|
+
interceptors: options.envKey === undefined ? [] : [(0, client_js_1.envKeyInterceptor)(options.envKey)],
|
|
224
|
+
}));
|
|
225
|
+
return createRecordBuffer({
|
|
226
|
+
async send(events, timeoutMs) {
|
|
227
|
+
await ingest.ingestActivityEvents({ events, workerId }, { timeoutMs });
|
|
228
|
+
},
|
|
229
|
+
envOf: (one) => one.env,
|
|
230
|
+
async report(reports, timeoutMs) {
|
|
231
|
+
await ingest.ingestActivityEvents({ workerId, reports }, { timeoutMs });
|
|
232
|
+
},
|
|
233
|
+
}, options);
|
|
234
|
+
}
|
|
180
235
|
//# sourceMappingURL=sink.js.map
|
package/dist/cjs/sink.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sink.js","sourceRoot":"","sources":["../../src/sink.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sink.js","sourceRoot":"","sources":["../../src/sink.ts"],"names":[],"mappings":";;;;AAAA,qCAAmC;AAEnC,iDAAoF;AACpF,2DAAkE;AAGlE,2CAAgD;AAChD,uEAAmE;AAgDnE,SAAS,GAAG,CAAC,MAA2B,EAAE,GAAW,EAAE,CAAS;IAC9D,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACvC,IAAI,GAAG,KAAK,CAAC;QAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;;QAC7B,MAAM,CAAC,GAAG,CAAC,GAAG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,MAAM,CAAC,oBAAoB,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;QAC1E,CAAC;KACF,EACD,OAAO,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Sinks, type WorkflowInterceptorsFactory } from '@temporalio/workflow';
|
|
2
|
+
/** The sink flowrensicQuerySinks fills in on the worker. */
|
|
3
|
+
export interface FlowrensicSinks extends Sinks {
|
|
4
|
+
flowrensic: {
|
|
5
|
+
/** One query the workflow answered, ok when the handler returned. */
|
|
6
|
+
query(name: string, ok: boolean): void;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
/** Tells the sink about every query a workflow answers. */
|
|
10
|
+
export declare const interceptors: WorkflowInterceptorsFactory;
|
|
11
|
+
//# sourceMappingURL=workflow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../src/workflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,KAAK,EAAE,KAAK,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AAKhG,4DAA4D;AAC5D,MAAM,WAAW,eAAgB,SAAQ,KAAK;IAC5C,UAAU,EAAE;QACV,qEAAqE;QACrE,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,GAAG,IAAI,CAAC;KACxC,CAAC;CACH;AAID,2DAA2D;AAC3D,eAAO,MAAM,YAAY,EAAE,2BAezB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.interceptors = void 0;
|
|
4
|
+
const workflow_1 = require("@temporalio/workflow");
|
|
5
|
+
const { flowrensic } = (0, workflow_1.proxySinks)();
|
|
6
|
+
/** Tells the sink about every query a workflow answers. */
|
|
7
|
+
const interceptors = () => ({
|
|
8
|
+
inbound: [
|
|
9
|
+
{
|
|
10
|
+
async handleQuery(input, next) {
|
|
11
|
+
try {
|
|
12
|
+
const result = await next(input);
|
|
13
|
+
flowrensic.query(input.queryName, true);
|
|
14
|
+
return result;
|
|
15
|
+
}
|
|
16
|
+
catch (err) {
|
|
17
|
+
flowrensic.query(input.queryName, false);
|
|
18
|
+
throw err;
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
});
|
|
24
|
+
exports.interceptors = interceptors;
|
|
25
|
+
//# sourceMappingURL=workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow.js","sourceRoot":"","sources":["../../src/workflow.ts"],"names":[],"mappings":";;;AAAA,mDAAgG;AAahG,MAAM,EAAE,UAAU,EAAE,GAAG,IAAA,qBAAU,GAAmB,CAAC;AAErD,2DAA2D;AACpD,MAAM,YAAY,GAAgC,GAAG,EAAE,CAAC,CAAC;IAC9D,OAAO,EAAE;QACP;YACE,KAAK,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI;gBAC3B,IAAI,CAAC;oBACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,CAAC;oBACjC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;oBACxC,OAAO,MAAM,CAAC;gBAChB,CAAC;gBAAC,OAAO,GAAG,EAAE,CAAC;oBACb,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;oBACzC,MAAM,GAAG,CAAC;gBACZ,CAAC;YACH,CAAC;SACF;KACF;CACF,CAAC,CAAC;AAfU,QAAA,YAAY,GAAZ,YAAY,CAetB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { WorkflowClientInterceptor, WorkflowQueryInput } from '@temporalio/client';
|
|
1
|
+
import type { WorkflowClientInterceptor, WorkflowQueryInput, WorkflowSignalInput } from '@temporalio/client';
|
|
2
2
|
import type { Next } from '@temporalio/common';
|
|
3
|
-
|
|
3
|
+
import { type BufferOptions, type SinkCounts } from './sink.js';
|
|
4
|
+
export interface ClientInterceptorOptions extends BufferOptions {
|
|
4
5
|
/** The Flowrensic server to send to. */
|
|
5
6
|
baseUrl: string;
|
|
6
7
|
/** The Flowrensic namespace id of the namespace this client talks to, the same one the worker interceptor is given. */
|
|
@@ -9,19 +10,29 @@ export interface ClientInterceptorOptions {
|
|
|
9
10
|
envKey?: string;
|
|
10
11
|
}
|
|
11
12
|
/**
|
|
12
|
-
* Sends every query that throws to Flowrensic, with
|
|
13
|
-
* whether it ended on its deadline. A
|
|
14
|
-
*
|
|
13
|
+
* Sends every query and signal that throws to Flowrensic, with its name, the
|
|
14
|
+
* workflow it was for and whether it ended on its deadline. A call that works
|
|
15
|
+
* is not sent. The calls wait in a buffer and are sent in batches, as the
|
|
16
|
+
* worker sink sends attempts, so sending never changes what the caller gets or
|
|
17
|
+
* how long it waits.
|
|
15
18
|
*/
|
|
16
19
|
export declare class FlowrensicClientInterceptor implements WorkflowClientInterceptor {
|
|
17
20
|
private readonly options;
|
|
18
|
-
private readonly
|
|
21
|
+
private readonly buffer;
|
|
19
22
|
constructor(options: ClientInterceptorOptions);
|
|
20
23
|
query(input: WorkflowQueryInput, next: Next<WorkflowClientInterceptor, 'query'>): Promise<unknown>;
|
|
21
|
-
|
|
24
|
+
signal(input: WorkflowSignalInput, next: Next<WorkflowClientInterceptor, 'signal'>): Promise<void>;
|
|
25
|
+
/** Send what is buffered and wait for it to land. */
|
|
26
|
+
flush(): Promise<void>;
|
|
27
|
+
/** Send what is buffered and stop. */
|
|
28
|
+
close(): Promise<void>;
|
|
29
|
+
/** What the buffer lost and holds. */
|
|
30
|
+
counts(): SinkCounts;
|
|
31
|
+
private record;
|
|
22
32
|
}
|
|
23
33
|
/**
|
|
24
34
|
* Pass to `new Client({ interceptors: { workflow: [flowrensicClientInterceptor({ baseUrl, namespaceId })] } })`.
|
|
35
|
+
* Call close before the process ends, so the calls still waiting are sent.
|
|
25
36
|
*/
|
|
26
|
-
export declare function flowrensicClientInterceptor(options: ClientInterceptorOptions):
|
|
37
|
+
export declare function flowrensicClientInterceptor(options: ClientInterceptorOptions): FlowrensicClientInterceptor;
|
|
27
38
|
//# sourceMappingURL=client-interceptor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-interceptor.d.ts","sourceRoot":"","sources":["../../src/client-interceptor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"client-interceptor.d.ts","sourceRoot":"","sources":["../../src/client-interceptor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC7G,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAI/C,OAAO,EAAsB,KAAK,aAAa,EAAmB,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AASrG,MAAM,WAAW,wBAAyB,SAAQ,aAAa;IAC7D,wCAAwC;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,uHAAuH;IACvH,WAAW,EAAE,MAAM,CAAC;IACpB,yEAAyE;IACzE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAwBD;;;;;;GAMG;AACH,qBAAa,2BAA4B,YAAW,yBAAyB;IAG/D,OAAO,CAAC,QAAQ,CAAC,OAAO;IAFpC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAyB;IAEhD,YAA6B,OAAO,EAAE,wBAAwB,EAW7D;IAEK,KAAK,CAAC,KAAK,EAAE,kBAAkB,EAAE,IAAI,EAAE,IAAI,CAAC,yBAAyB,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAOvG;IAEK,MAAM,CAAC,KAAK,EAAE,mBAAmB,EAAE,IAAI,EAAE,IAAI,CAAC,yBAAyB,EAAE,QAAQ,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAOvG;IAED,qDAAqD;IAC/C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAE3B;IAED,sCAAsC;IAChC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAE3B;IAED,sCAAsC;IACtC,MAAM,IAAI,UAAU,CAEnB;IAED,OAAO,CAAC,MAAM;CAcf;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,wBAAwB,GAAG,2BAA2B,CAE1G"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { timestampFromDate } from '@bufbuild/protobuf/wkt';
|
|
2
2
|
import { createFlowrensicClient } from './client.js';
|
|
3
3
|
import { ClientCallOutcome } from './gen/flowrensic/v1/client_calls_pb.js';
|
|
4
|
+
import { createRecordBuffer } from './sink.js';
|
|
4
5
|
/** The gRPC status a call that ended on its deadline carries. */
|
|
5
6
|
const DEADLINE_EXCEEDED = 4;
|
|
6
7
|
/** The gRPC status of a cancelled call. */
|
|
@@ -27,50 +28,73 @@ function endedOnDeadline(err) {
|
|
|
27
28
|
return status.code === CANCELLED && status.details !== CANCELLED_ON_CLIENT;
|
|
28
29
|
}
|
|
29
30
|
/**
|
|
30
|
-
* Sends every query that throws to Flowrensic, with
|
|
31
|
-
* whether it ended on its deadline. A
|
|
32
|
-
*
|
|
31
|
+
* Sends every query and signal that throws to Flowrensic, with its name, the
|
|
32
|
+
* workflow it was for and whether it ended on its deadline. A call that works
|
|
33
|
+
* is not sent. The calls wait in a buffer and are sent in batches, as the
|
|
34
|
+
* worker sink sends attempts, so sending never changes what the caller gets or
|
|
35
|
+
* how long it waits.
|
|
33
36
|
*/
|
|
34
37
|
export class FlowrensicClientInterceptor {
|
|
35
38
|
options;
|
|
36
|
-
|
|
39
|
+
buffer;
|
|
37
40
|
constructor(options) {
|
|
38
41
|
this.options = options;
|
|
39
|
-
|
|
42
|
+
const client = createFlowrensicClient(options.baseUrl, options.envKey === undefined ? {} : { envKey: options.envKey });
|
|
43
|
+
this.buffer = createRecordBuffer({
|
|
44
|
+
async send(calls, timeoutMs) {
|
|
45
|
+
await client.ingest.ingestClientCalls({ calls }, { timeoutMs });
|
|
46
|
+
},
|
|
47
|
+
envOf: () => '',
|
|
48
|
+
}, options);
|
|
40
49
|
}
|
|
41
50
|
async query(input, next) {
|
|
42
51
|
try {
|
|
43
52
|
return await next(input);
|
|
44
53
|
}
|
|
45
54
|
catch (err) {
|
|
46
|
-
|
|
55
|
+
this.record('query', input.queryType, input.workflowExecution, err);
|
|
47
56
|
throw err;
|
|
48
57
|
}
|
|
49
58
|
}
|
|
50
|
-
async
|
|
51
|
-
const timedOut = endedOnDeadline(err);
|
|
59
|
+
async signal(input, next) {
|
|
52
60
|
try {
|
|
53
|
-
await
|
|
54
|
-
calls: [
|
|
55
|
-
{
|
|
56
|
-
namespaceId: this.options.namespaceId,
|
|
57
|
-
workflowId: input.workflowExecution.workflowId,
|
|
58
|
-
runId: input.workflowExecution.runId ?? '',
|
|
59
|
-
kind: 'query',
|
|
60
|
-
outcome: timedOut ? ClientCallOutcome.TIMED_OUT : ClientCallOutcome.FAILED,
|
|
61
|
-
errorType: err instanceof Error ? err.constructor.name : 'Unknown',
|
|
62
|
-
endedAt: timestampFromDate(new Date()),
|
|
63
|
-
},
|
|
64
|
-
],
|
|
65
|
-
});
|
|
61
|
+
await next(input);
|
|
66
62
|
}
|
|
67
|
-
catch {
|
|
68
|
-
|
|
63
|
+
catch (err) {
|
|
64
|
+
this.record('signal', input.signalName, input.workflowExecution, err);
|
|
65
|
+
throw err;
|
|
69
66
|
}
|
|
70
67
|
}
|
|
68
|
+
/** Send what is buffered and wait for it to land. */
|
|
69
|
+
async flush() {
|
|
70
|
+
await this.buffer.flush();
|
|
71
|
+
}
|
|
72
|
+
/** Send what is buffered and stop. */
|
|
73
|
+
async close() {
|
|
74
|
+
await this.buffer.close();
|
|
75
|
+
}
|
|
76
|
+
/** What the buffer lost and holds. */
|
|
77
|
+
counts() {
|
|
78
|
+
return this.buffer.counts();
|
|
79
|
+
}
|
|
80
|
+
record(kind, name, execution, err) {
|
|
81
|
+
const timedOut = endedOnDeadline(err);
|
|
82
|
+
this.buffer.record({
|
|
83
|
+
$typeName: 'flowrensic.v1.ClientCall',
|
|
84
|
+
namespaceId: this.options.namespaceId,
|
|
85
|
+
workflowId: execution.workflowId,
|
|
86
|
+
runId: execution.runId ?? '',
|
|
87
|
+
kind,
|
|
88
|
+
name,
|
|
89
|
+
outcome: timedOut ? ClientCallOutcome.TIMED_OUT : ClientCallOutcome.FAILED,
|
|
90
|
+
errorType: err instanceof Error ? err.constructor.name : 'Unknown',
|
|
91
|
+
endedAt: timestampFromDate(new Date()),
|
|
92
|
+
});
|
|
93
|
+
}
|
|
71
94
|
}
|
|
72
95
|
/**
|
|
73
96
|
* Pass to `new Client({ interceptors: { workflow: [flowrensicClientInterceptor({ baseUrl, namespaceId })] } })`.
|
|
97
|
+
* Call close before the process ends, so the calls still waiting are sent.
|
|
74
98
|
*/
|
|
75
99
|
export function flowrensicClientInterceptor(options) {
|
|
76
100
|
return new FlowrensicClientInterceptor(options);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-interceptor.js","sourceRoot":"","sources":["../../src/client-interceptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAI3D,OAAO,EAAE,sBAAsB,
|
|
1
|
+
{"version":3,"file":"client-interceptor.js","sourceRoot":"","sources":["../../src/client-interceptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAI3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAmB,MAAM,wCAAwC,CAAC;AAC5F,OAAO,EAAE,kBAAkB,EAA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,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;IAC9B,CAAC;IAEO,MAAM,CAAC,IAAY,EAAE,IAAY,EAAE,SAAkD,EAAE,GAAY;QACzG,MAAM,QAAQ,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC;QACtC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;YACjB,SAAS,EAAE,0BAA0B;YACrC,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,WAAW;YACrC,UAAU,EAAE,SAAS,CAAC,UAAU;YAChC,KAAK,EAAE,SAAS,CAAC,KAAK,IAAI,EAAE;YAC5B,IAAI;YACJ,IAAI;YACJ,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,CAAC,iBAAiB,CAAC,MAAM;YAC1E,SAAS,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;YAClE,OAAO,EAAE,iBAAiB,CAAC,IAAI,IAAI,EAAE,CAAC;SACvC,CAAC,CAAC;IACL,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,UAAU,2BAA2B,CAAC,OAAiC;IAC3E,OAAO,IAAI,2BAA2B,CAAC,OAAO,CAAC,CAAC;AAClD,CAAC"}
|
package/dist/esm/client.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { type Client, type Interceptor } from '@connectrpc/connect';
|
|
2
|
-
import { CatalogService, IngestService, QueryService } from './gen/flowrensic/v1/services_pb.js';
|
|
2
|
+
import { CatalogService, IngestService, QueryService, RemediationService, ResetService } from './gen/flowrensic/v1/services_pb.js';
|
|
3
3
|
export interface FlowrensicClient {
|
|
4
4
|
catalog: Client<typeof CatalogService>;
|
|
5
5
|
ingest: Client<typeof IngestService>;
|
|
6
6
|
query: Client<typeof QueryService>;
|
|
7
|
+
reset: Client<typeof ResetService>;
|
|
8
|
+
remediation: Client<typeof RemediationService>;
|
|
7
9
|
}
|
|
8
10
|
export interface FlowrensicClientOptions {
|
|
9
11
|
/** The access key of the env this client sends data for. Every ingest call carries it. */
|
package/dist/esm/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlF,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlF,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,YAAY,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAEnI,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC,OAAO,cAAc,CAAC,CAAC;IACvC,MAAM,EAAE,MAAM,CAAC,OAAO,aAAa,CAAC,CAAC;IACrC,KAAK,EAAE,MAAM,CAAC,OAAO,YAAY,CAAC,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC,OAAO,YAAY,CAAC,CAAC;IACnC,WAAW,EAAE,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAC;CAChD;AAED,MAAM,WAAW,uBAAuB;IACtC,0FAA0F;IAC1F,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oGAAoG;IACpG,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,oEAAoE;AACpE,eAAO,MAAM,cAAc,uBAAuB,CAAC;AAEnD,kDAAkD;AAClD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,CAK7D;AAED,oEAAoE;AACpE,eAAO,MAAM,eAAe,wBAAwB,CAAC;AAErD,sDAAsD;AACtD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,CAO/D;AAED,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,uBAA4B,GACpC,gBAAgB,CAgBlB"}
|
package/dist/esm/client.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createClient } from '@connectrpc/connect';
|
|
2
2
|
import { createConnectTransport } from '@connectrpc/connect-node';
|
|
3
|
-
import { CatalogService, IngestService, QueryService } from './gen/flowrensic/v1/services_pb.js';
|
|
3
|
+
import { CatalogService, IngestService, QueryService, RemediationService, ResetService } from './gen/flowrensic/v1/services_pb.js';
|
|
4
4
|
/** The header every ingest call carries the env's access key in. */
|
|
5
5
|
export const ENV_KEY_HEADER = 'Flowrensic-Env-Key';
|
|
6
6
|
/** Puts envKey on every call of IngestService. */
|
|
@@ -35,6 +35,8 @@ export function createFlowrensicClient(baseUrl, options = {}) {
|
|
|
35
35
|
catalog: createClient(CatalogService, transport),
|
|
36
36
|
ingest: createClient(IngestService, transport),
|
|
37
37
|
query: createClient(QueryService, transport),
|
|
38
|
+
reset: createClient(ResetService, transport),
|
|
39
|
+
remediation: createClient(RemediationService, transport),
|
|
38
40
|
};
|
|
39
41
|
}
|
|
40
42
|
//# sourceMappingURL=client.js.map
|
package/dist/esm/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAiC,MAAM,qBAAqB,CAAC;AAClF,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EA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,OAAO;QACP,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE;YACZ,GAAG,CAAC,OAAO,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;YAC5E,GAAG,CAAC,OAAO,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;SAChF;KACF,CAAC,CAAC;IACH,OAAO;QACL,OAAO,EAAE,YAAY,CAAC,cAAc,EAAE,SAAS,CAAC;QAChD,MAAM,EAAE,YAAY,CAAC,aAAa,EAAE,SAAS,CAAC;QAC9C,KAAK,EAAE,YAAY,CAAC,YAAY,EAAE,SAAS,CAAC;QAC5C,KAAK,EAAE,YAAY,CAAC,YAAY,EAAE,SAAS,CAAC;QAC5C,WAAW,EAAE,YAAY,CAAC,kBAAkB,EAAE,SAAS,CAAC;KACzD,CAAC;AACJ,CAAC"}
|
|
@@ -6,8 +6,8 @@ import type { Message } from "@bufbuild/protobuf";
|
|
|
6
6
|
*/
|
|
7
7
|
export declare const file_flowrensic_v1_client_calls: GenFile;
|
|
8
8
|
/**
|
|
9
|
-
* ClientCall is one query a Temporal client made that threw, as the
|
|
10
|
-
* interceptor saw it.
|
|
9
|
+
* ClientCall is one query or signal a Temporal client made that threw, as the
|
|
10
|
+
* client interceptor saw it.
|
|
11
11
|
*
|
|
12
12
|
* @generated from message flowrensic.v1.ClientCall
|
|
13
13
|
*/
|
|
@@ -27,7 +27,7 @@ export type ClientCall = Message<"flowrensic.v1.ClientCall"> & {
|
|
|
27
27
|
*/
|
|
28
28
|
runId: string;
|
|
29
29
|
/**
|
|
30
|
-
* What was called
|
|
30
|
+
* What was called: "query" or "signal".
|
|
31
31
|
*
|
|
32
32
|
* @generated from field: string kind = 4;
|
|
33
33
|
*/
|
|
@@ -44,6 +44,12 @@ export type ClientCall = Message<"flowrensic.v1.ClientCall"> & {
|
|
|
44
44
|
* @generated from field: google.protobuf.Timestamp ended_at = 7;
|
|
45
45
|
*/
|
|
46
46
|
endedAt?: Timestamp | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* The name of the query or signal called.
|
|
49
|
+
*
|
|
50
|
+
* @generated from field: string name = 8;
|
|
51
|
+
*/
|
|
52
|
+
name: string;
|
|
47
53
|
};
|
|
48
54
|
/**
|
|
49
55
|
* Describes the message flowrensic.v1.ClientCall.
|
|
@@ -78,6 +84,84 @@ export type IngestClientCallsResponse = Message<"flowrensic.v1.IngestClientCalls
|
|
|
78
84
|
* Use `create(IngestClientCallsResponseSchema)` to create a new message.
|
|
79
85
|
*/
|
|
80
86
|
export declare const IngestClientCallsResponseSchema: GenMessage<IngestClientCallsResponse>;
|
|
87
|
+
/**
|
|
88
|
+
* QueryCount is how many queries of one name the workers of one workflow type
|
|
89
|
+
* answered in one minute, FPP-011-R02.
|
|
90
|
+
*
|
|
91
|
+
* @generated from message flowrensic.v1.QueryCount
|
|
92
|
+
*/
|
|
93
|
+
export type QueryCount = Message<"flowrensic.v1.QueryCount"> & {
|
|
94
|
+
/**
|
|
95
|
+
* namespace_id is the Flowrensic namespace id the worker was given.
|
|
96
|
+
*
|
|
97
|
+
* @generated from field: string namespace_id = 1;
|
|
98
|
+
*/
|
|
99
|
+
namespaceId: string;
|
|
100
|
+
/**
|
|
101
|
+
* env is the env the worker runs in, empty to use the env of the namespace.
|
|
102
|
+
*
|
|
103
|
+
* @generated from field: string env = 2;
|
|
104
|
+
*/
|
|
105
|
+
env: string;
|
|
106
|
+
/**
|
|
107
|
+
* @generated from field: string workflow_type = 3;
|
|
108
|
+
*/
|
|
109
|
+
workflowType: string;
|
|
110
|
+
/**
|
|
111
|
+
* @generated from field: string query_name = 4;
|
|
112
|
+
*/
|
|
113
|
+
queryName: string;
|
|
114
|
+
/**
|
|
115
|
+
* answered is the queries the handler answered, failed the ones whose
|
|
116
|
+
* handler threw.
|
|
117
|
+
*
|
|
118
|
+
* @generated from field: int64 answered = 5;
|
|
119
|
+
*/
|
|
120
|
+
answered: bigint;
|
|
121
|
+
/**
|
|
122
|
+
* @generated from field: int64 failed = 6;
|
|
123
|
+
*/
|
|
124
|
+
failed: bigint;
|
|
125
|
+
/**
|
|
126
|
+
* minute is the start of the minute the queries were answered in.
|
|
127
|
+
*
|
|
128
|
+
* @generated from field: google.protobuf.Timestamp minute = 7;
|
|
129
|
+
*/
|
|
130
|
+
minute?: Timestamp | undefined;
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* Describes the message flowrensic.v1.QueryCount.
|
|
134
|
+
* Use `create(QueryCountSchema)` to create a new message.
|
|
135
|
+
*/
|
|
136
|
+
export declare const QueryCountSchema: GenMessage<QueryCount>;
|
|
137
|
+
/**
|
|
138
|
+
* @generated from message flowrensic.v1.IngestQueryCountsRequest
|
|
139
|
+
*/
|
|
140
|
+
export type IngestQueryCountsRequest = Message<"flowrensic.v1.IngestQueryCountsRequest"> & {
|
|
141
|
+
/**
|
|
142
|
+
* @generated from field: repeated flowrensic.v1.QueryCount counts = 1;
|
|
143
|
+
*/
|
|
144
|
+
counts: QueryCount[];
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* Describes the message flowrensic.v1.IngestQueryCountsRequest.
|
|
148
|
+
* Use `create(IngestQueryCountsRequestSchema)` to create a new message.
|
|
149
|
+
*/
|
|
150
|
+
export declare const IngestQueryCountsRequestSchema: GenMessage<IngestQueryCountsRequest>;
|
|
151
|
+
/**
|
|
152
|
+
* @generated from message flowrensic.v1.IngestQueryCountsResponse
|
|
153
|
+
*/
|
|
154
|
+
export type IngestQueryCountsResponse = Message<"flowrensic.v1.IngestQueryCountsResponse"> & {
|
|
155
|
+
/**
|
|
156
|
+
* @generated from field: int32 accepted = 1;
|
|
157
|
+
*/
|
|
158
|
+
accepted: number;
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* Describes the message flowrensic.v1.IngestQueryCountsResponse.
|
|
162
|
+
* Use `create(IngestQueryCountsResponseSchema)` to create a new message.
|
|
163
|
+
*/
|
|
164
|
+
export declare const IngestQueryCountsResponseSchema: GenMessage<IngestQueryCountsResponse>;
|
|
81
165
|
/**
|
|
82
166
|
* ClientCallOutcome is how a call a Temporal client made went wrong.
|
|
83
167
|
*
|